3 * The core password hash interface
5 * All pasword implementations must implement this interface
9 * @category PHPCryptLib
11 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
12 * @copyright 2011 The Authors
13 * @license http://www.opensource.org/licenses/mit-license.html MIT License
14 * @version Build @@version@@
17 namespace CryptLib\Password
;
20 * The core password key interface
22 * All pasword implementations must implement this interface
24 * @category PHPCryptLib
26 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
32 * Determine if the hash was made with this method
34 * @param string $hash The hashed data to check
36 * @return boolean Was the hash created by this method
38 public static function detect($hash);
41 * Return the prefix used by this hashing method
43 * @return string The prefix used
45 public static function getPrefix();
48 * Load an instance of the class based upon the supplied hash
50 * @param string $hash The hash to load from
52 * @return Password the created instance
54 public static function loadFromHash($hash);
57 * Create a password hash for a given plain text password
59 * @param string $password The password to hash
61 * @return string The formatted password hash
63 public function create($password);
66 * Verify a password hash against a given plain text password
68 * @param string $password The password to hash
69 * @param string $hash The supplied ahsh to validate
71 * @return boolean Does the password validate against the hash
73 public function verify($password, $hash);