Skip to content

pbkdf2: fix MCF Base64; add SHA-512 MCF support#808

Merged
tarcieri merged 1 commit intomasterfrom
pbkdf2/fix-mcf-base64-and-add-sha512
Jan 11, 2026
Merged

pbkdf2: fix MCF Base64; add SHA-512 MCF support#808
tarcieri merged 1 commit intomasterfrom
pbkdf2/fix-mcf-base64-and-add-sha512

Conversation

@tarcieri
Copy link
Copy Markdown
Member

I discovered these test vectors from a Go port of Passlib:

https://github.com/hlandau/passlib/blob/8f820e0/hash/pbkdf2/pbkdf2_test.go

...and also checked against the Python implementation of Passlib itself, and discovered PBKDF2 seems to use its own variant of Base64 which is distinct from the ones used by bcrypt/crypt, namely it's a variant of unpadded Base64 which swaps + for .

This implements this Base64 variant, and also adds a test vector from the Go implementation of Passlib for PBKDF2-SHA-512.

I discovered these test vectors from a Go port of Passlib:

https://github.com/hlandau/passlib/blob/8f820e0/hash/pbkdf2/pbkdf2_test.go

...and also checked against the Python implementation of Passlib itself,
and discovered PBKDF2 seems to use its own variant of Base64 which is
distinct from the ones used by bcrypt/crypt, namely it's a variant of
unpadded Base64 which swaps `+` for `.`

This implements this Base64 variant, and also adds a test vector from
the Go implementation of Passlib for PBKDF2-SHA-512.
@tarcieri tarcieri merged commit 7c232a7 into master Jan 11, 2026
15 checks passed
@tarcieri tarcieri deleted the pbkdf2/fix-mcf-base64-and-add-sha512 branch January 11, 2026 23:59
@tarcieri tarcieri mentioned this pull request Apr 20, 2026
tarcieri added a commit that referenced this pull request Apr 21, 2026
## Added
- Customizable `Params` for `Pbkdf2` type (#79])
- Modular Crypt Format (MCF) support (#806, #808)
- `alloc` feature (#816)
- `kdf::{Kdf, Pbkdf}` implementations (#823)

## Changed
- Bump edition to 2024; MSRV 1.85 (#563)
- Use `EagerHash` in bounds (#592)
- Use `phc` crate for PHC hash types (#761)
- Rename `simple` features to `phc` (#776)
- Have `Pbkdf2::new` take algorithm/params args (#805)
- Fallible `Params` constructors (#810)
- Bump `password-hash` dependency to v0.6 (#848)
- Bump `digest` dependency to v0.11 (#849)
- Use 210,000 iterations for PBKDF2-HMAC-SHA512 per OWASP (#857)
- Bump `hmac` dependency to v0.13 (#870)
- Bump `sha2` to v0.11 (#872)

## Removed
- `parallel` crate feature (#702)
- `std` feature (#760)
- `sha1` feature (#853)
- `Sync` bounds (#876)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant