Botan  1.10.9
passhash9.h
Go to the documentation of this file.
1 /*
2 * Passhash9 Password Hashing
3 * (C) 2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
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 * all other values are currently undefined
25 */
26 std::string BOTAN_DLL generate_passhash9(const std::string& password,
27  RandomNumberGenerator& rng,
28  u16bit work_factor = 10,
29  byte alg_id = 0);
30 
31 /**
32 * Check a previously created password hash
33 * @param password the password to check against
34 * @param hash the stored hash to check against
35 */
36 bool BOTAN_DLL check_passhash9(const std::string& password,
37  const std::string& hash);
38 
39 }
40 
41 #endif
bool check_passhash9(const std::string &pass, const std::string &hash)
Definition: passhash9.cpp:84
unsigned char byte
Definition: types.h:22
RandomNumberGenerator * rng
Definition: global_rng.cpp:165
unsigned short u16bit
Definition: types.h:27
std::string generate_passhash9(const std::string &pass, RandomNumberGenerator &rng, u16bit work_factor, byte alg_id)
Definition: passhash9.cpp:48