pbkdf2: fix MCF Base64; add SHA-512 MCF support#808
Merged
Conversation
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.
Merged
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.