← 返回命令列表

Linux command

argon2 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Hash

echo -n "password" | argon2 [salt] -e

Example

echo -n "password" | argon2 [salt] -id -e

Example

echo -n "password" | argon2 [salt] -t [3] -m [16] -p [4] -e

Output raw bytes

echo -n "password" | argon2 [salt] -r

Pin to Argon2 version 13

echo -n "password" | argon2 [salt] -v [13] -e

说明

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.

参数

-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.

FAQ

What is the argon2 command used for?

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.

How do I run a basic argon2 example?

Run `echo -n "password" | argon2 [salt] -e` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d do in argon2?

Use Argon2d (data-dependent, GPU-resistant). Default is Argon2i.