Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ Parameters:
For deployments with a server-side *pepper*, use `pbkdf2_with_pepper(password, salt, pepper, iters, dkLen)`.
The pepper is a secret key stored separately from the hashed password.

### PBKDF2 Security Notes

- Use a random salt of **at least 16 bytes** and never reuse it.
- Choose an iteration count that takes roughly **200–500 ms** on your target hardware (~2025).
- Store `{salt, iterations}` alongside the ciphertext or hash; these values are public.
- Salts and iteration counts must be unique per password.
- Example serialization: `{magic|ver|prf|salt|iters|dkLen|…}`.

#### PBKDF2-HMAC-SHA256 + AES-GCM

```cpp
Expand Down
7 changes: 7 additions & 0 deletions include/hmac_cpp/hmac_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ namespace hmac_cpp {
/// \brief Hash choices for PBKDF2
enum class Pbkdf2Hash { Sha1, Sha256, Sha512 };

/// PBKDF2 Security Notes:
/// - Use a random salt of at least 16 bytes and never reuse it.
/// - Choose iterations so the derivation takes about 200–500 ms on 2025 hardware.
/// - Store {salt, iterations} with the ciphertext or hash; these values are public.
/// - Salts and iteration counts must be unique per password.
/// - Example serialization: {magic|ver|prf|salt|iters|dkLen|…}.

/// \brief Derives a key from a password using PBKDF2 (RFC 8018)
/// \param password_ptr Pointer to the password buffer
/// \param password_len Length of the password in bytes
Expand Down
Loading