LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

argon2

Hash passwords using the Argon2 algorithm

TLDR

Hash a password
$ echo -n "password" | argon2 [salt] -e
copy
Hash with Argon2id variant
$ echo -n "password" | argon2 [salt] -id -e
copy
Hash with custom parameters
$ echo -n "password" | argon2 [salt] -t [3] -m [16] -p [4] -e
copy
Output raw bytes instead of encoded form
$ echo -n "password" | argon2 [salt] -r
copy
Pin to Argon2 version 13 (current standard)
$ echo -n "password" | argon2 [salt] -v [13] -e
copy

SYNOPSIS

argon2 salt [-d|-i|-id] [-t iterations] [-m memory] [-p parallelism] [-l length] [-e|-r] [-v 10|13]

DESCRIPTION

argon2 is a command-line tool for the Argon2 password hashing algorithm, winner of the Password Hashing Competition in 2015. It provides strong, memory-hard password hashing resistant to GPU and ASIC attacks.The tool supports Argon2d (data-dependent), Argon2i (data-independent), and Argon2id (hybrid) variants.

PARAMETERS

-d

Use Argon2d (data-dependent, GPU-resistant). Default is Argon2i.
-i
Use Argon2i (data-independent, side-channel resistant). This is the default if no variant flag is given.
-id
Use Argon2id (hybrid; recommended for password hashing).
-t N
Time cost (iterations). Default: 3.
-m N
Memory cost expressed as 2^N KiB. Default: 12 (4 MiB).
-p N
Parallelism (threads). Default: 1.
-l N
Output hash length in bytes. Default: 32.
-e
Print only the encoded hash (PHC string format).
-r
Print only the raw hash bytes.
-v 10|13
Argon2 algorithm version. Default: 13.
-h
Display tool usage and exit.

INSTALL

sudo apt install argon2
copy
sudo dnf install argon2
copy
sudo pacman -S argon2
copy
sudo apk add argon2
copy
sudo zypper install argon2
copy
brew install argon2
copy

CAVEATS

Salt must be provided as a positional argument and should be at least 8 random bytes. Higher memory/time costs improve security but increase computation time. Argon2id is recommended for password hashing. The CLI hashes only — there is no built-in verification mode; verify hashes from a library that understands the PHC-encoded output.

HISTORY

Argon2 was designed by Alex Biryukov, Daniel Dinu, and Dmitry Khovratovich, winning the Password Hashing Competition in 2015. It's recommended by OWASP for password hashing.

SEE ALSO

openssl(1), bcrypt(1), mkpasswd(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid