Botan 1.10.17

bcrypt.h
Go to the documentation of this file.
1 /*
2 * Bcrypt Password Hashing
3 * (C) 2011 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_BCRYPT_H__
9 #define BOTAN_BCRYPT_H__
10
11 #include <botan/rng.h>
12
13 namespace Botan {
14
15 /**
16 * Create a password hash using Bcrypt
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 *
21 * @see http://www.usenix.org/events/usenix99/provos/provos_html/
22 */
23 std::string BOTAN_DLL generate_bcrypt(const std::string& password,
24 RandomNumberGenerator& rng,
25 u16bit work_factor = 10);
26
27 /**
28 * Check a previously created password hash
29 * @param password the password to check against
30 * @param hash the stored hash to check against
31 */
32 bool BOTAN_DLL check_bcrypt(const std::string& password,
33 const std::string& hash);
34
35 }
36
37 #endif
Botan::check_bcrypt
bool check_bcrypt(const std::string &pass, const std::string &hash)
Definition: bcrypt.cpp:128
Botan::generate_bcrypt
std::string generate_bcrypt(const std::string &pass, RandomNumberGenerator &rng, u16bit work_factor)
Definition: bcrypt.cpp:121
Botan::u16bit
unsigned short u16bit
Definition: types.h:27
Botan
Definition: algo_base.h:14