[−][src]Module pwhash::bsdi_crypt
Enhanced DES-based hash.
This algorithm was developed by BSDi for BSD/OS as an extension of the traditional Unix crypt(3). It supports longer passwords, larger salt, and a variable number of rounds. Despite that, the algorithm is considered weak and is not recommended for new passwords.
Example
use pwhash::{bsdi_crypt, HashSetup}; assert_eq!(bsdi_crypt::hash_with( HashSetup { salt: Some("K0Ay"), rounds: Some(7250) }, "password").unwrap(), "_Gl/.K0Ay.aosctsbJ1k");
Parameters
-
Password length: unlimited.
-
Salt length: 4 characters (24 bits).
-
Rounds: 1 to 224-1. Default is 7250.
Hash Format
The format of the hash is _
{rounds}{salt}{checksum}
, where:
-
{rounds}
is a 4-character Base64 encoding of the number of rounds. -
{salt}
is a 4-character Base64 encoding of the salt. -
{checksum}
is a 11-character Base64 encoding of the checksum.
Constants
DEFAULT_ROUNDS | Default number of rounds. |
SALT_LEN | Salt length. |
Functions
hash | [ Deprecated ] Hash a password with a randomly generated salt and the default number of rounds. |
hash_with | [ Deprecated ] Hash a password with user-provided parameters. |
verify | Verify that the hash corresponds to a password. |