Enigma
3.2.0
A Simple, Reliable and Efficient Encryption Tool
|
#include <RSA.hpp>
Classes | |
struct | RSASettings |
Public Member Functions | |
RSA (const Algorithm::Intent intent) noexcept | |
~RSA () noexcept override | |
void | setSettings (RSASettings &&settings) |
std::vector< byte > | Encrypt (const std::string &password, const byte *buffer, const std::size_t buffSize) override |
std::vector< byte > | Encrypt (const std::string &password, const std::vector< byte > &buffer) override |
std::vector< byte > | Decrypt (const std::string &password, const byte *cipher, const std::size_t cipherSize) override |
std::vector< byte > | Decrypt (const std::string &password, const std::vector< byte > &cipher) override |
void | Encrypt (const std::string &password, const fs::path &in_filename, const fs::path &out_filename) override |
void | Decrypt (const std::string &password, const fs::path &in_filename, const fs::path &out_filename) override |
bool | SignAndVerify (const std::vector< byte > &message) |
std::string | getPrivateKey () const |
std::string | getPublicKey () const |
std::size_t | getMaximumBufferSize () const |
Public Member Functions inherited from Algorithm | |
ENIGMA_ENUM_CLASS_BITWISE_OPERATORS (Intent, Enigma::byte) | |
Algorithm (const Type type, const Intent intent=Intent::Encrypt|Intent::Decrypt) noexcept | |
virtual | ~Algorithm () noexcept |
Type | GetType () const noexcept |
void | SetType (const Type type) noexcept |
std::string | GetTypeString () const noexcept |
Static Public Member Functions | |
static std::size_t | getMaximumBufferSizeFromKeySize (const std::size_t keySize) |
Static Public Member Functions inherited from Algorithm | |
static std::unique_ptr< Algorithm > | CreateFromName (const std::string &name, const Intent intent) |
static std::unique_ptr< Algorithm > | CreateFromType (const Type type, const Intent intent) |
static std::string | AlgoTypeEnumToStr (const Algorithm::Type e) noexcept |
static std::string | GetSupportedAlgorithmsStr () noexcept |
static std::vector< std::pair< std::string, Algorithm::Type > > | GetSupportedAlgorithms () noexcept |
Static Public Attributes | |
static const std::map< std::size_t, std::string_view > | RECOMMENDED_KEY_SIZES |
Key, description. More... | |
Static Public Attributes inherited from Algorithm | |
static const std::unordered_map< Type, std::string_view > | ALGORITHM_DESCRIPTIONS |
Additional Inherited Members | |
Public Types inherited from Algorithm | |
enum class | Intent : Enigma::byte { None = 0 << 0 , Encrypt = 1 << 1 , Decrypt = 1 << 2 , All = Encrypt | Decrypt } |
enum class | Type : byte { AES = 0x01 , Twofish , TripleDES , Blowfish , IDEA , ChaCha20Poly1305 , RSA , Camellia , Serpent } |
Static Protected Member Functions inherited from Algorithm | |
static std::vector< byte > | GenerateRandomIV (const std::size_t size) |
Protected Attributes inherited from Algorithm | |
Type | m_type {} |
Intent | m_intent {} |
Static Protected Attributes inherited from Algorithm | |
static std::unique_ptr< CryptoPP::AutoSeededRandomPool > | m_auto_seeded_random_pool {nullptr} |
RSA-AES-GCM Algorithm Encryptor/Decryptor
RSA is a public-key cryptosystem, one of the oldest widely used for secure data transmission
|
explicitnoexcept |
intent | Operation, Encrypt or Decrypt |
|
overridenoexcept |
|
overridevirtual |
|
overridevirtual |
Decrypts a file with password
password | Password used in encryption |
in_filename | Filename to decrypt |
out_filename | Filename to recover |
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
|
overridevirtual |
Implements Algorithm.
|
overridevirtual |
Encrypts buffer with password
password | Encryption password |
buffer | Buffer to encrypt (text, binary...) an array of bytes |
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
|
overridevirtual |
Encrypts a file with password
password | Encryption password |
in_filename | Filename to encrypt |
out_filename | Filename to store encrypted cipher |
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
|
overridevirtual |
Implements Algorithm.
std::size_t RSA::getMaximumBufferSize | ( | ) | const |
|
static |
std::string RSA::getPrivateKey | ( | ) | const |
std::string RSA::getPublicKey | ( | ) | const |
void RSA::setSettings | ( | RSASettings && | settings | ) |
|
inline |
|
inlinestatic |
Key, description.