#include <nawa/hashing/HashingEngine/HashingEngine.h>
Inherited by nawa::hashing::Argon2HashingEngine, and nawa::hashing::BcryptHashingEngine.
Public Member Functions | |
virtual std::string | generateHash (std::string input) const =0 |
virtual bool | verifyHash (std::string input, std::string hash) const =0 |
A hashing engine must implement these functions in order to be useful for password hashing. It may store additional information (such as cost and salt) in its object, the user should be able to set them as constructor parameters. It is expected that the salt is automatically generated, giving the user an option to manually specify the salt is optional but recommended.
Definition at line 37 of file HashingEngine.h.
|
pure virtual |
Generate a (salted) hash basing on the input (usually the password to be hashed). Throw a nawa::Exception with an error code >=10 in case of failure.
input | The input string (e.g., user password). |
Implemented in nawa::hashing::Argon2HashingEngine, and nawa::hashing::BcryptHashingEngine.
|
pure virtual |
Check whether the input string has been used to produce the hash. This function should not need to throw exceptions.
input | The input string (e.g., password the user entered). |
hash | The stored hash containing all necessary information. |
Implemented in nawa::hashing::Argon2HashingEngine, and nawa::hashing::BcryptHashingEngine.