|
lintel 0.2.0
|
#include <Cryption.h>
Public Member Functions | |
| Cryption () | |
Static Public Member Functions | |
| static std::string | hashOf (const std::string &password) |
| static bool | verifyOf (const std::string &password, const std::string &storedHash) |
| static bool | isModernHash (const std::string &storedHash) |
| static std::string | hashOfSha512 (const std::string &text) |
| static std::string | encodeBase64 (const std::string &in) |
| static std::string | decodeBase64 (const std::string &in) |
Utility class providing cryptographic hash and Base64 encoding/decoding operations.
| lintel::Cryption::Cryption | ( | ) |
Default constructor.
Decode a Base64-encoded string.
| in | the Base64-encoded input |
Encode a string to Base64.
| in | the input string |
Compute a salted, iterated hash (PBKDF2-HMAC-SHA512) of the given password. The result embeds salt and iteration count, so it is safe for password storage. Format: $pbkdf2-sha512$<iterations>$<salt-hex>$<derived-hex>.
| password | the password to hash |
Compute the legacy plain SHA-512 hex hash (kept for migration purposes).
| text | the input text |
|
static |
Verify a password against a stored hash. Supports the modern salted PBKDF2 format as well as legacy plain SHA-512 hex hashes.
| password | the password to check |
| storedHash | the stored hash |