#include <Serpent.hpp>
|
| Serpent (const Algorithm::Intent intent) noexcept |
|
| ~Serpent () noexcept override |
|
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 |
|
| 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 |
|
|
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 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 const std::unordered_map< Type, std::string_view > | ALGORITHM_DESCRIPTIONS |
|
static std::vector< byte > | GenerateRandomIV (const std::size_t size) |
|
Type | m_type {} |
|
Intent | m_intent {} |
|
static std::unique_ptr< CryptoPP::AutoSeededRandomPool > | m_auto_seeded_random_pool {nullptr} |
|
Serpent-GCM Algorithm Encryptor/Decryptor
Serpent is a block cipher designed by Ross Anderson, Eli Biham, and Lars Knudsen. It was ranked 2nd in the Advanced Encryption Standard contest. The Serpent homepage is located at http://www.cl.cam.ac.uk/~rja14/serpent.html.
Definition at line 12 of file Serpent.hpp.
◆ Serpent()
- Parameters
-
intent | Operation, Encrypt or Decrypt |
◆ ~Serpent()
◆ Decrypt() [1/3]
std::vector<byte> Serpent::Decrypt |
( |
const std::string & |
password, |
|
|
const byte * |
cipher, |
|
|
const std::size_t |
cipherSize |
|
) |
| |
|
overridevirtual |
Decrypts cipher with password
- Parameters
-
password | Password used in encryption |
cipher | Cipher with Enigma meta data |
- Returns
- Recovered Buffer
- Exceptions
-
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
◆ Decrypt() [2/3]
void Serpent::Decrypt |
( |
const std::string & |
password, |
|
|
const fs::path & |
in_filename, |
|
|
const fs::path & |
out_filename |
|
) |
| |
|
overridevirtual |
Decrypts a file with password
- Parameters
-
password | Password used in encryption |
in_filename | Filename to decrypt |
out_filename | Filename to recover |
- Exceptions
-
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
◆ Decrypt() [3/3]
std::vector<byte> Serpent::Decrypt |
( |
const std::string & |
password, |
|
|
const std::vector< byte > & |
cipher |
|
) |
| |
|
overridevirtual |
◆ Encrypt() [1/3]
std::vector<byte> Serpent::Encrypt |
( |
const std::string & |
password, |
|
|
const byte * |
buffer, |
|
|
const std::size_t |
buffSize |
|
) |
| |
|
overridevirtual |
Encrypts buffer with password
- Parameters
-
password | Encryption password |
buffer | Buffer to encrypt (text, binary...) an array of bytes |
- Returns
- Cipher with Enigma meta data
- Exceptions
-
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
◆ Encrypt() [2/3]
void Serpent::Encrypt |
( |
const std::string & |
password, |
|
|
const fs::path & |
in_filename, |
|
|
const fs::path & |
out_filename |
|
) |
| |
|
overridevirtual |
Encrypts a file with password
- Parameters
-
password | Encryption password |
in_filename | Filename to encrypt |
out_filename | Filename to store encrypted cipher |
- Exceptions
-
throws | CryptoPP::Exception, std::exception on failure |
Implements Algorithm.
◆ Encrypt() [3/3]
std::vector<byte> Serpent::Encrypt |
( |
const std::string & |
password, |
|
|
const std::vector< byte > & |
buffer |
|
) |
| |
|
overridevirtual |
The documentation for this class was generated from the following file: