2

I have been using Argon2 in my terminal (Debian), but I keep messing up, and I have been unable to find the manual or any other documentation that lists examples of commands that work.

Could someone give me a basic rundown of what the most important commands are? Or point me to a good reference?

I have the usage right in front of me, but that does not help me much.

Usage:  argon2 [-h] salt [-i|-d|-id] [-t iterations] [-m log2(memory in KiB) | -k memory in KiB] [-p parallelism] [-l hash length] [-e|-r] [-v (10|13)]
    Password is read from stdin
Parameters:
    salt        The salt to use, at least 8 characters
    -i      Use Argon2i (this is the default)
    -d      Use Argon2d instead of Argon2i
    -id     Use Argon2id instead of Argon2i
    -t N        Sets the number of iterations to N (default = 3)
    -m N        Sets the memory usage of 2^N KiB (default 12)
    -k N        Sets the memory usage of N KiB (default 4096)
    -p N        Sets parallelism to N threads (default 1)
    -l N        Sets hash output length to N bytes (default 32)
    -e      Output only encoded hash
    -r      Output only the raw bytes of the hash
    -v (10|13)  Argon2 version (defaults to the most recent version, currently 13)
    -h      Print argon2 usage
Patriot
  • 123
  • 1
  • 6

1 Answers1

2

You can run:

echo -n "hashThis" | argon2 saltItWithSalt -l 32

which will give you an output like with multiple lines of information about the resulting hash.

To get a one-line return of the same information encoded into a single argon2 string, you can add -e at the end. If you just want the raw bytes, use -r instead of -e.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
v0lZy
  • 36
  • 1