R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
Argon2PasswordHasher.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** r-type
4** File description:
5** Argon2PasswordHasher - Argon2id password hashing implementation
6*/
7
8#pragma once
9
10#include <cstdint>
11#include "IPasswordHasher.hpp"
12
29 public:
34
43 Argon2PasswordHasher(uint32_t timeCost, uint32_t memoryCost, uint32_t parallelism, size_t hashLength = 32,
44 size_t saltLength = 16);
45
46 ~Argon2PasswordHasher() override = default;
47
54 std::string hash(const std::string &password) override;
55
62 bool verify(const std::string &password, const std::string &hash) override;
63
64 private:
65 uint32_t _timeCost;
66 uint32_t _memoryCost;
67 uint32_t _parallelism;
70};
Argon2id password hashing wrapper.
~Argon2PasswordHasher() override=default
std::string hash(const std::string &password) override
Hash a plaintext password using Argon2id.
bool verify(const std::string &password, const std::string &hash) override
Verify a password against an Argon2id hash.
Argon2PasswordHasher()
Constructor with default parameters.
Abstract interface for password hashing algorithms.