Skip to content

Commit

Permalink
Mention only running the algorithm once when deriving multiple keys
Browse files Browse the repository at this point in the history
As discussed in #14.
  • Loading branch information
samuel-lucas6 committed Jun 22, 2024
1 parent 485b521 commit 3587262
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions draft-lucas-balloon-hashing.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ The salt MUST be unique each time you call the function unless verifying a passw

The `spaceCost`, `timeCost`, and `parallelism` MUST be carefully chosen to avoid denial-of-service and user frustration whilst ensuring adequate protection against password cracking.

If you want to derive multiple keys (e.g. for encryption and authentication), you MUST only run the algorithm once and use different portions of the output as separate keys. Otherwise, the attacker may have an advantage, like only needing to run the algorithm once instead of twice to check a password, and you will be forced to use weaker parameters.

Avoid using hardcoded `spaceCost`/`timeCost`/`parallelism` parameters when performing password hashing; these SHOULD be stored as part of the password hash, as described in {{encoding-password-hashes}}. With key derivation, hardcoded parameters are acceptable if protocol versioning is used.

For password hashing, it is RECOMMENDED to encrypt password hashes using an authenticated encryption with associated data (AEAD) scheme {{?RFC5116}} before storage. This forces an attacker to compromise the key, which is stored separately from the database, as well as the database before they can begin password cracking. If the key is compromised but the database is not, it can be rotated without having to reset any passwords.
Expand Down

0 comments on commit 3587262

Please sign in to comment.