NAWA 0.9
Web Application Framework for C++
crypto.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2022 Tobias Flaig.
3 *
4 * This file is part of nawa.
5 *
6 * nawa is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License,
8 * version 3, as published by the Free Software Foundation.
9 *
10 * nawa is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with nawa. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24#ifndef NAWA_CRYPTO_H
25#define NAWA_CRYPTO_H
26
31#include <string>
32
33namespace nawa::crypto {
41 std::string sha1(std::string const& input, bool hex = true);
42
50 std::string sha224(std::string const& input, bool hex = true);
51
59 std::string sha256(std::string const& input, bool hex = true);
60
68 std::string sha384(std::string const& input, bool hex = true);
69
77 std::string sha512(std::string const& input, bool hex = true);
78
86 std::string md5(std::string const& input, bool hex = true);
87
100 std::string passwordHash(std::string const& password,
102
116 bool passwordVerify(std::string const& password, std::string const& hash,
118
119}// namespace nawa::crypto
120
121#endif//NAWA_CRYPTO_H
Hashing engine for password hashing using Argon2.
Default implementation of a HashTypeTable containing the hashing engines included in nawa.
Abstract base class for hashing engines.
Abstract base class for hashing engines.
std::string sha512(std::string const &input, bool hex=true)
Definition: crypto.cpp:81
bool passwordVerify(std::string const &password, std::string const &hash, hashing::HashTypeTable const &hashTypeTable=hashing::DefaultHashTypeTable())
Definition: crypto.cpp:110
std::string passwordHash(std::string const &password, hashing::HashingEngine const &hashingEngine=hashing::BcryptHashingEngine())
Definition: crypto.cpp:105
std::string sha1(std::string const &input, bool hex=true)
Definition: crypto.cpp:33
std::string md5(std::string const &input, bool hex=true)
Definition: crypto.cpp:93
std::string sha224(std::string const &input, bool hex=true)
Definition: crypto.cpp:45
std::string sha384(std::string const &input, bool hex=true)
Definition: crypto.cpp:69
std::string sha256(std::string const &input, bool hex=true)
Definition: crypto.cpp:57