node-argon2-cli
CLI utility for node-argon2.
Want to use it in your Javascript application? Instead check node-argon2.
Before installing
Check requirements for node-argon2 prior to installing this.
node-argon2-cli works only and is tested against Node >=8.0.0.
Usage
Run argon2-cli -h
for a quick help on usage and arguments:
$ argon2-cli -husage: argon2-cli [-h] salt [-i|-d|-id] [-t iterations] [-m log2 | -k memory in KiB] [-p parallelism] [-l hash length] [-e|-r] [-v ] Password is read from stdin Positional arguments: salt Optional arguments: -h, --help Show this help message and exit. -i Use Argon2i -d Use Argon2d instead of Argon2i -id Use Argon2id instead of Argon2i -t N Sets the number of iterations to N -m N Sets the memory usage to 2^N KiB -k N Sets the memory usage to N KiB -p N Sets parallelism to N threads -l N Sets hash output length to N bytes -e Output only encoded hash -r Output only the raw bytes of the hash -v Argon2 version
To hash a password:
$ echo -n "password" | argon2-cliType: Argon2iIterations: 3Memory: 4096 KiBParallelism: 1Encoded: $argon2i$v=19$m=4096,t=3,p=1$lwEEWp+MVB8ha79mVt8Gog$KXc3+y9Lg4YBm0C1nxk7t6j3ku4pw/uyd4RfVq3e8yI0.010 secondsVerification ok
By default, the output is verbose. You can output the hash only with -e
:
$ echo -n "password" | argon2-cli -e$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4
You can choose between Argon2i and Argon2d by using the -d
flag:
$ echo -n "password" | argon2-cli -d -e$argon2d$v=19$m=4096,t=3,p=1$diS6FEpcDzlFacSfAHyWSw$+JLnSo3YQP/CJ7g2cRSx6YjC1eRmxHPETmd99R6eaa8
You can provide your own salt as the positional argument. It is highly recommended to use the generated salt instead of a hardcoded salt, though:
$ echo -n "password" | argon2-cli somesalt -e$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$iWh06vD8Fy27wf9npn6FXWiCX4K6pW6Ue1Bnzz07Z8A
You can also modify time, memory and parallelism constraints with -t
, -m
and
-p
respectively, followed by a valid number:
$ echo -n "password" | argon2-cli -t 2 -k 65536 -p 4Type: Argon2iIterations: 2Memory: 65536 KiBParallelism: 4Encoded: $argon2i$v=19$m=65536,t=2,p=4$1LoWDI7KvUoSIUlA+26nHw$KK1P9iYjYn8+FE1ACGWFNhC3UfJsc1LYS7ciMcxS7EA0.058 secondsVerification ok
All arguments are optional, and it's not possible to pass your password as
argument for safety purposes (consider you should never write a password with
echo
).
License
Work licensed under the MIT License. Please check P-H-C/phc-winner-argon2 for license over Argon2 and the reference implementation.