Browse code

Add implementation

Robert Cranston authored on 16/11/2023 00:31:51
Showing 1 changed files
... ...
@@ -2,9 +2,38 @@
2 2
 
3 3
 A thin command-line wrapper around [`crypt(3)`][] and [`crypt_gensalt(3)`][].
4 4
 
5
+**NOTE**: This security-related software includes no error checking and uses
6
+functions whose documentation states "This function is obsolete. Do not use
7
+it.". Results are platform-dependent and should be verified manually. It exists
8
+because its constituent 15 non-empty lines of C provides functionality
9
+(specifically [`yescrypt`][], the default password hashing scheme on many Linux
10
+distributions, with automatic parameter encoding and salt generation) that at
11
+the time of writing is not easily accessible from the command line elsewhere
12
+([OpenSSL's `passwd`][], [Perl's `crypt`][], [Python's `crypt`][], [Python's
13
+`hashlib`][]).
14
+
5 15
 [`cryptgen`]: https://git.rcrnstn.net/rcrnstn/cryptgen
6 16
 [`crypt(3)`]: https://manpages.debian.org/crypt.3
7 17
 [`crypt_gensalt(3)`]: https://manpages.debian.org/crypt_gensalt.3
18
+[`yescrypt`]: https://www.openwall.com/yescrypt
19
+[OpenSSL's `passwd`]: https://github.com/openssl/openssl/issues/19340
20
+[Perl's `crypt`]: https://perldoc.perl.org/functions/crypt
21
+[Python's `crypt`]: https://docs.python.org/3/library/crypt
22
+[Python's `hashlib`]: https://docs.python.org/3/library/hashlib
23
+
24
+## Usage
25
+
26
+```
27
+cryptgen [<prefix> [<count>]]
28
+```
29
+
30
+where the valid values of the optional `<prefix>` (hashing method) and
31
+`<count>` ("CPU time cost") parameters are documented in [`crypt(5)`][]. On
32
+most distributions, if `<prefix>` is not given the best available hashing
33
+method will be selected, if `<count>` is not given a low default cost will be
34
+selected.
35
+
36
+[`crypt(5)`]: https://manpages.debian.org/crypt.5
8 37
 
9 38
 ## License
10 39
 
Browse code

Add license

Robert Cranston authored on 15/11/2023 23:50:57
Showing 1 changed files
... ...
@@ -5,3 +5,11 @@ A thin command-line wrapper around [`crypt(3)`][] and [`crypt_gensalt(3)`][].
5 5
 [`cryptgen`]: https://git.rcrnstn.net/rcrnstn/cryptgen
6 6
 [`crypt(3)`]: https://manpages.debian.org/crypt.3
7 7
 [`crypt_gensalt(3)`]: https://manpages.debian.org/crypt_gensalt.3
8
+
9
+## License
10
+
11
+Licensed under the [BSD Zero Clause License][] unless otherwise noted, see the
12
+[`LICENSE`][] file.
13
+
14
+[[BSD Zero Clause License]]: https://choosealicense.com/licenses/0bsd
15
+[`LICENSE`]: LICENSE
Browse code

Add readme

Robert Cranston authored on 15/11/2023 23:50:53
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+# [`cryptgen`][]
2
+
3
+A thin command-line wrapper around [`crypt(3)`][] and [`crypt_gensalt(3)`][].
4
+
5
+[`cryptgen`]: https://git.rcrnstn.net/rcrnstn/cryptgen
6
+[`crypt(3)`]: https://manpages.debian.org/crypt.3
7
+[`crypt_gensalt(3)`]: https://manpages.debian.org/crypt_gensalt.3