In the Linux program
Argon2, we need to supply the salt in the command line. This limits the salt to be printable characters. How can we use a binary string as the salt?
# argon2 -h
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
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
I tried using
\x0A notation does not work. As see below,
\x0a produce different hashes.
# cat /tmp/keyfile | argon2 "\x0A\x0B\x0C\x0D\x1A\x1B\x1C\x1D" -id -t 4 -m 5 -p 1 -l 64 -r
# cat /tmp/keyfile | argon2 "\x0a\x0B\x0C\x0D\x1A\x1B\x1C\x1D" -id -t 4 -m 5 -p 1 -l 64 -r
For extra information, I would like to use Argon to simulate LUKS's PBKDF.