Botan  2.1.0
Crypto and TLS for C++11
passhash9.h
Go to the documentation of this file.
1 /*
2 * Passhash9 Password Hashing
3 * (C) 2010 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_PASSHASH9_H__
9 #define BOTAN_PASSHASH9_H__
10 
11 #include <botan/rng.h>
12 
13 namespace Botan {
14 
15 /**
16 * Create a password hash using PBKDF2
17 * @param password the password
18 * @param rng a random number generator
19 * @param work_factor how much work to do to slow down guessing attacks
20 * @param alg_id specifies which PRF to use with PBKDF2
21 * 0 is HMAC(SHA-1)
22 * 1 is HMAC(SHA-256)
23 * 2 is CMAC(Blowfish)
24 * 3 is HMAC(SHA-384)
25 * 4 is HMAC(SHA-512)
26 * all other values are currently undefined
27 */
28 std::string BOTAN_DLL generate_passhash9(const std::string& password,
29  RandomNumberGenerator& rng,
30  uint16_t work_factor = 10,
31  uint8_t alg_id = 1);
32 
33 /**
34 * Check a previously created password hash
35 * @param password the password to check against
36 * @param hash the stored hash to check against
37 */
38 bool BOTAN_DLL check_passhash9(const std::string& password,
39  const std::string& hash);
40 
41 }
42 
43 #endif
bool check_passhash9(const std::string &pass, const std::string &hash)
Definition: passhash9.cpp:75
Definition: alg_id.cpp:13
std::string generate_passhash9(const std::string &pass, RandomNumberGenerator &rng, uint16_t work_factor, uint8_t alg_id)
Definition: passhash9.cpp:43
MechanismType hash