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
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
I tried using \x0A
notation does not work. As see below, \x0A
and \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
6694bba14b3955a77beea3fb4c6018bd86953627949df2bc7e57bc7597519d2fed64a24380757bf6d963115656ce0ddcf59b2504b736036c239101c3e069849b
# cat /tmp/keyfile | argon2 "\x0a\x0B\x0C\x0D\x1A\x1B\x1C\x1D" -id -t 4 -m 5 -p 1 -l 64 -r
3e97b90537a9ecdceaee638aee2b122c89a2cc3e03630bac31cf72c9b7e3e0565a4c3945eb7fc2a04922bb1453cc5fdafc3303327097749b0ceb87111cd1349c
For extra information, I would like to use Argon to simulate LUKS's PBKDF.