20#ifndef ORES_ACCOUNTS_SECURITY_PASSWORD_MANAGER_HPP
21#define ORES_ACCOUNTS_SECURITY_PASSWORD_MANAGER_HPP
24#include "ores.utility/log/make_logger.hpp"
26namespace ores::accounts::security {
38 inline static std::string_view logger_name =
39 "ores.accounts.security.password_manager";
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 DEFAULT_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;
96 const std::string &hash);
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:30
Manages password hashing and verification using the scrypt algorithm.
Definition password_manager.hpp:36
static bool verify_password_hash(const std::string &password, const std::string &hash)
Verifies a password against a stored hash.
Definition password_manager.cpp:68
static std::string create_password_hash(const std::string &password)
Creates a password hash from the given password.
Definition password_manager.cpp:39