[−][src]Enum pwhash::bcrypt::BcryptVariant
Identifiers of algorithm variants which can be produced.
Bcrypt has a long history of use, during which a number bugs were found and fixed in the widely-used implementations. Some bugs were serious enough to warrant a change in the minor version number of the algorithm identifier.
There are two major bcrypt implementations: OpenBSD (the original, used in all *BSDs) and Openwall. A short history of variants is as follows:
-
2 is the original OpenBSD version, which was very quickly replaced by
-
2a, which fixed a bug that caused passwords with repeated strings to produce the same hash as those with a single string ("abab" hashed the same as "ab".) This was the most widely used version, until
-
2y, produced by Openwall, which fixed a sign-extension bug that caused certain passwords with high-bit-set characters to produce weak keys. OpenBSD didn't have this bug, and their logic can transparently handle the 2y hashes. The Openwall fix also introduced
-
2x, meant for unambiguously identifying pre-fix 2a hashes as those produced by the buggy algorithm. OpenBSD doesn't treat 2x hashes specially, which means that it won't be able to verify buggy hashes. Some time later, a wraparound bug was found in OpenBSD, leading to
-
2b, which fixed the bug. As the problem involved unrealistically long passwords, the bug was, fortunately, mostly theoretical. This variant is the current default in most implementations.
This crate has a single bcrypt algorithm implementation which is equivalent to the 2b variant. It accepts 2a and 2y on input, and can generate both on output, but doesn't treat them specially in any way.
Variants
Second OpenBSD variant, fixed repeated string hashing.
Third OpenBSD variant, fixed a wraparound bug.
Openwall variant, fixed a sign extension bug.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BcryptVariant
[src]
impl Send for BcryptVariant
[src]
impl Sync for BcryptVariant
[src]
impl Unpin for BcryptVariant
[src]
impl UnwindSafe for BcryptVariant
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,