7 #pragma warning(push, 0)
21 #include <chachapoly.h>
89 {
Type::AES,
"Symmetric, extremely high security, efficient, widely supported"},
90 {
Type::Twofish,
"Symmetric, high security, flexible and efficient"},
91 {
Type::TripleDES,
"Symmetric, moderate security, suitable for legacy systems"},
93 {
Type::IDEA,
"Symmetric, moderate to high security, simple and efficient"},
95 {
Type::RSA,
"Asymmetric, very high security, excellent for key exchange"},
96 {
Type::Camellia,
"Symmetric, very high security, comparable to AES"},
97 {
Type::Serpent,
"Symmetric, high security, conservative design"},
112 virtual std::vector<
byte>
Encrypt(const std::
string& password, const
byte *buffer, const std::
size_t buffSize) = 0;
113 virtual std::vector<
byte>
Encrypt(const std::
string& password, const std::vector<
byte>& buffer) = 0;
121 virtual std::vector<
byte>
Decrypt(const std::
string& password, const
byte *cipher, const std::
size_t cipherSize) = 0;
122 virtual std::vector<
byte>
Decrypt(const std::
string& password, const std::vector<
byte>& cipher) = 0;
131 virtual
void Encrypt(const std::
string& password, const fs::path& in_filename, const fs::path& out_filename) = 0;
139 virtual
void Decrypt(const std::
string& password, const fs::path& in_filename, const fs::path& out_filename) = 0;
169 static Type DetectFromCipher(
const std::string& cipher);
174 static Type DetectFromCipherBase64(
const std::string& cipher_base64);
179 static Type DetectFromFile(
const std::string& filename);
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
#define ENIGMA_ENUM_DECLARE_BEGIN_END(begin)
Allows looping over an enum by providing a BEGIN and END enum values NOTE: should be placed at the en...
Algorithm abstract class.
Type GetType() const noexcept
virtual std::vector< byte > Decrypt(const std::string &password, const byte *cipher, const std::size_t cipherSize)=0
std::string GetTypeString() const noexcept
static std::string AlgoTypeEnumToStr(const Algorithm::Type e) noexcept
Algorithm(const Type type, const Intent intent=Intent::Encrypt|Intent::Decrypt) noexcept
virtual ~Algorithm() noexcept
static const std::unordered_map< Type, std::string_view > ALGORITHM_DESCRIPTIONS
static std::vector< byte > GenerateRandomIV(const std::size_t size)
static std::unique_ptr< CryptoPP::AutoSeededRandomPool > m_auto_seeded_random_pool
static std::vector< std::pair< std::string, Algorithm::Type > > GetSupportedAlgorithms() noexcept
void SetType(const Type type) noexcept
static std::unique_ptr< Algorithm > CreateFromName(const std::string &name, const Intent intent)
ENIGMA_ENUM_CLASS_BITWISE_OPERATORS(Intent, Enigma::byte)
static std::unique_ptr< Algorithm > CreateFromType(const Type type, const Intent intent)
static std::string GetSupportedAlgorithmsStr() noexcept
virtual std::vector< byte > Encrypt(const std::string &password, const byte *buffer, const std::size_t buffSize)=0