How to generate argon2id hash on the command line using argon2

Use the following command to generate an argon2id hash on the command line using argon2 and a random salt:

example.sh
echo -n 'your_password' | argon2 $(openssl rand -base64 16) -id -e

Example output

example.txt
$argon2id$v=19$m=4096,t=3,p=1$ekQ0Qi9UcVBFVmdxTldMTklhUlZPUT09$NINhlCVSg3Py0qfmGotyns5KWXt+HwUciPRa1BUS9ao

Check out similar posts by category: Cryptography