38 inline static std::string_view logger_name =
39 "ores.security.crypto.password_hasher";
41 [[nodiscard]]
static auto& lg() {
43 static auto instance = make_logger(logger_name);
50 static std::string base64_encode(
const std::vector<unsigned char>& data);
55 static std::vector<unsigned char> base64_decode(
const std::string& encoded);
58 static constexpr std::uint64_t PRODUCTION_N = 1 << 14;
59 static constexpr std::uint32_t DEFAULT_r = 8;
60 static constexpr std::uint32_t DEFAULT_p = 1;
61 static constexpr std::size_t SALT_LEN = 16;
62 static constexpr std::size_t HASH_LEN = 64;
65 static constexpr std::uint64_t TEST_N = 1 << 10;
73 static std::uint64_t get_n_parameter();
92 static std::string
hash(
const std::string &password);
106 static bool verify(
const std::string& password,
const std::string &
hash);
static bool verify(const std::string &password, const std::string &hash)
Verifies a password against a stored hash.
Definition password_hasher.cpp:79