Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Nov 14, 2024
1 parent 1b5d857 commit b9ce3df
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,25 @@ Options:
-i, --iterations <ITERATIONS>
Number of iterations (must be greater than 1 and lesser than or equal to 4294967295) [default: 100]
-l, --length <LENGTH>
Length of the derived result (must be greater than 10 and lesser than or equal to 128) [default: 32]
Length of the derived result (must be greater than 9 and lesser than or equal to 64) [default: 32]
--base64
Show the result in Base64 (in addition to hex)
--base58
Show the result in Base58 (in addition to hex)
--output <OUTPUT>
Optional path for storing the encrypted output
--scrypt-n <SCRYPT_N>
Scrypt CPU/memory cost parameter (must be lesser than 18446744073709551615) [default: 1048576]
--scrypt-log-n <SCRYPT_LOG_N>
Scrypt CPU/memory cost parameter (must be lesser than 64) [default: 20]
--scrypt-r <SCRYPT_R>
Scrypt block size parameter, which fine-tunes sequential memory read size and performance (must be greater than 0 and lesser than or equal to 4294967295) [default: 8]
--scrypt-p <SCRYPT_P>
Scrypt parallelization parameter (must be greater than 0 and lesser than 4294967295) [default: 1]
--argon2-m-cost <ARGON2_M_COST>
Argon2 number of 1 KiB memory block (must be greater than 8 and lesser than 4294967295) [default: 2097152]
--argon2-t-cost <ARGON2_T_COST>
Argon2 number of iterations (must be greater than 2 and lesser than 4294967295) [default: 2]
Argon2 number of iterations (must be greater than 1 and lesser than 4294967295) [default: 2]
--argon2-p-cost <ARGON2_P_COST>
Argon2 Degree of parallelism (must be greater than 1 and lesser than 16777215) [default: 1]
--checkpoint-dir <CHECKPOINT_DIR>
Optional directory for storing encrypted checkpoints, each appended with an iteration-specific suffix. For each iteration i, the corresponding checkpoint file is named "checkpoint.i", indicating the iteration number at which the checkpoint was created
--checkpoint-interval <CHECKPOINT_INTERVAL>
Expand Down Expand Up @@ -215,8 +217,8 @@ Please input all data either in raw or hex format starting with the 0x prefix
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -300,8 +302,8 @@ Checkpoint will be created every 5 iterations and saved to the "~/checkpoints" c
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -331,8 +333,8 @@ Checkpoint:
SlowKey Parameters:
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
```
We can also verify that the password and salt match the checkpoint by passing the optional `--verify` flag:
Expand All @@ -352,8 +354,8 @@ Checkpoint:
SlowKey Parameters:
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -383,8 +385,8 @@ Checkpoint:
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -428,8 +430,8 @@ Checkpoint:
SlowKey Parameters:
Iterations: 20
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -466,8 +468,8 @@ Please input all data either in raw or hex format starting with the 0x prefix
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -500,8 +502,8 @@ Please input all data either in raw or hex format starting with the 0x prefix
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
████████████████████████████████████████████████████████████████████████████████ 10/10 100% (0s)
Expand Down Expand Up @@ -540,8 +542,8 @@ Output:
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
```
The output file checkpoint, except for the one that coincides with the first iteration, also includes the output of the previous iteration. This allows the system to verify that the password and salt match the output by attempting to derive the output's data from the previous iteration's data. This verification is optional and requires the `--verify` flag:
Expand All @@ -561,8 +563,8 @@ Output:
SlowKey Parameters:
Iterations: 10
Length: 32
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
✔ Enter your salt · ********
Expand Down Expand Up @@ -595,6 +597,7 @@ Test vectors:
- version: 19
- m_cost: 2097152
- t_cost: 2
- p: 1
### #2
Expand All @@ -610,6 +613,7 @@ Test vectors:
- version: 19
- m_cost: 2097152
- t_cost: 2
- p: 1
Results should be:
Expand All @@ -619,17 +623,17 @@ Password: ""
SlowKey Parameters:
Iterations: 1
Length: 64
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
Derived key: 0xb2c1bcd2674c0c96473e61b17d6e30d6e8a46ac258f730075b476a732284c64e36df041f7bd50260d68128b62e6cffac03e4ff585025d18b04d41dda4633b800
Salt: "SlowKeySlowKey16"
Password: "Hello World"
SlowKey Parameters:
Iterations: 3
Length: 64
Scrypt: (n: 1048576, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2)
Scrypt: (log_n: 20, r: 8, p: 1)
Argon2id: (version: 19, m_cost: 2097152, t_cost: 2, p_cost: 1)
Derived key: 0xe24c16e6912d2348e8be84977d22bd229382b72b65b501afe0066a32d6771df57f3557de0719070bbafb8faf1d0649562be693e3bf33c6e0a107d0af712030ef
```
Expand Down

0 comments on commit b9ce3df

Please sign in to comment.