|
NAMEAuthen::Passphrase::SaltedDigest - passphrases using the generic salted digest algorithm SYNOPSIS use Authen::Passphrase::SaltedDigest;
$ppr = Authen::Passphrase::SaltedDigest->new(
algorithm => "SHA-1",
salt_hex => "a9f524b1e819e96d8cc7".
"a04d5471e8b10c84e596",
hash_hex => "8270d9d1a345d3806ab2".
"3b0385702e10f1acc943");
$ppr = Authen::Passphrase::SaltedDigest->new(
algorithm => "SHA-1", salt_random => 20,
passphrase => "passphrase");
$ppr = Authen::Passphrase::SaltedDigest->from_rfc2307(
"{SSHA}gnDZ0aNF04BqsjsDhXAuEPGsy".
"UOp9SSx6BnpbYzHoE1UceixDITllg==");
$algorithm = $ppr->algorithm;
$salt = $ppr->salt;
$salt_hex = $ppr->salt_hex;
$hash = $ppr->hash;
$hash_hex = $ppr->hash_hex;
if($ppr->match($passphrase)) { ...
$userPassword = $ppr->as_rfc2307;
DESCRIPTIONAn object of this class encapsulates a passphrase hashed using a generic digest-algorithm-based scheme. This is a subclass of Authen::Passphrase, and this document assumes that the reader is familiar with the documentation for that class. The salt is an arbitrary string of bytes. It is appended to passphrase, and the combined string is passed through a specified message digest algorithm. The output of the message digest algorithm is the passphrase hash. The strength depends entirely on the choice of digest algorithm, so choose according to the level of security required. SHA-1 is suitable for most applications, but recent work has revealed weaknesses in the basic structure of MD5, SHA-1, SHA-256, and all similar digest algorithms. A new generation of digest algorithms emerged in 2008, centred around NIST's competition to design SHA-3. Once these algorithms have been subjected to sufficient cryptanalysis, the survivors will be preferred over SHA-1 and its generation. Digest algorithms are generally designed to be as efficient to compute as possible for their level of cryptographic strength. An unbroken digest algorithm makes brute force the most efficient way to attack it, but makes no effort to resist a brute force attack. This is a concern in some passphrase-using applications. The use of this kind of passphrase scheme is generally recommended for new systems. Choice of digest algorithm is important: SHA-1 is suitable for most applications. If efficiency of brute force attack is a concern, see Authen::Passphrase::BlowfishCrypt for an algorithm designed to be expensive to compute. CONSTRUCTORS
The digest algorithm must be given, and either the hash or the passphrase.
METHODS
SEE ALSOAuthen::Passphrase, Crypt::SaltedHash AUTHORAndrew Main (Zefram) <zefram@fysh.org> COPYRIGHTCopyright (C) 2006, 2007, 2009, 2010, 2012 Andrew Main (Zefram) <zefram@fysh.org> LICENSEThis module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|