pub struct Pbkdf2Hasher { /* private fields */ }Expand description
PBKDF2-HMAC-SHA256 password hasher (based on RustCrypto pbkdf2 crate).
Uses the PBKDF2-HMAC-SHA256 algorithm (RFC 8018).
Hash format: $<iterations>$<salt_hex>$<hash_hex>
Implementations§
Source§impl Pbkdf2Hasher
impl Pbkdf2Hasher
Sourcepub const MIN_ITERATIONS: u32 = 100_000
pub const MIN_ITERATIONS: u32 = 100_000
Iteration count upper and lower bounds (v4.8.0 fix for M-8):
- The lower bound aligns with the production default and rejects weak hashes with c<100_000 (black-hat demo showed c=1 was accepted).
- The upper bound prevents
$4294967295$...CPU DoS (a single verify could stall for minutes).
pub const MAX_ITERATIONS: u32 = 10_000_000
pub fn new() -> Self
pub fn with_iterations(iterations: u32) -> Self
Trait Implementations§
Source§impl Default for Pbkdf2Hasher
impl Default for Pbkdf2Hasher
Source§impl PasswordHasher for Pbkdf2Hasher
impl PasswordHasher for Pbkdf2Hasher
Auto Trait Implementations§
impl Freeze for Pbkdf2Hasher
impl RefUnwindSafe for Pbkdf2Hasher
impl Send for Pbkdf2Hasher
impl Sync for Pbkdf2Hasher
impl Unpin for Pbkdf2Hasher
impl UnsafeUnpin for Pbkdf2Hasher
impl UnwindSafe for Pbkdf2Hasher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more