Limo
A simple mod manager
Loading...
Searching...
No Matches
cryptography.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <stdexcept>
9#include <string>
10
11
15class CryptographyError : public std::runtime_error
16{
17public:
22 CryptographyError(const char* message) : std::runtime_error(message) {}
27 CryptographyError(const std::string& message) : std::runtime_error(message) {}
28};
29
30
31namespace cryptography
32{
40std::tuple<std::string, std::string, std::string> encrypt(const std::string& plain_text,
41 const std::string& key);
51std::string decrypt(const std::string& cipher_text,
52 const std::string& key,
53 const std::string& nonce,
54 const std::string& tag);
55
57constexpr char default_key[] = "rWnYJVdtxz8Iu62GSJy0OPlOat7imMb8";
58};
CryptographyError(const char *message)
Constructor.
Definition cryptography.h:22
CryptographyError(const std::string &message)
Constructor.
Definition cryptography.h:27
constexpr char default_key[]
A default encryption key used in case no key was specified.
Definition cryptography.h:57