Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
IDEA Class Reference

#include <IDEA.hpp>

Inheritance diagram for IDEA:
Algorithm

Public Member Functions

 IDEA (const Algorithm::Intent intent) noexcept
 
 ~IDEA () 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
 
- 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
 

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 Public Member Functions inherited from Algorithm
static std::unique_ptr< AlgorithmCreateFromName (const std::string &name, const Intent intent)
 
static std::unique_ptr< AlgorithmCreateFromType (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 inherited from Algorithm
static const std::unordered_map< Type, std::string_view > ALGORITHM_DESCRIPTIONS
 
- 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}
 

Detailed Description

IDEA-EAX Algorithm Encryptor/Decryptor

IDEA is the International Data Encryption Standard by Massey and Lai. The cipher is a 64-bit block cipher which uses 126-bit keys and a 64-bit initialization vector (IV). IDEA is a popular choice in open source projects such as OpenPGP.

Definition at line 11 of file IDEA.hpp.

Constructor & Destructor Documentation

◆ IDEA()

IDEA::IDEA ( const Algorithm::Intent  intent)
explicitnoexcept
Parameters
intentOperation, Encrypt or Decrypt

◆ ~IDEA()

IDEA::~IDEA ( )
overridenoexcept

Member Function Documentation

◆ Decrypt() [1/3]

std::vector<byte> IDEA::Decrypt ( const std::string &  password,
const byte *  cipher,
const std::size_t  cipherSize 
)
overridevirtual

Decrypts cipher with password

Parameters
passwordPassword used in encryption
cipherCipher with Enigma meta data
Returns
Recovered Buffer
Exceptions
throwsCryptoPP::Exception, std::exception on failure

Implements Algorithm.

◆ Decrypt() [2/3]

void IDEA::Decrypt ( const std::string &  password,
const fs::path &  in_filename,
const fs::path &  out_filename 
)
overridevirtual

Decrypts a file with password

Parameters
passwordPassword used in encryption
in_filenameFilename to decrypt
out_filenameFilename to recover
Exceptions
throwsCryptoPP::Exception, std::exception on failure

Implements Algorithm.

◆ Decrypt() [3/3]

std::vector<byte> IDEA::Decrypt ( const std::string &  password,
const std::vector< byte > &  cipher 
)
overridevirtual

Implements Algorithm.

◆ Encrypt() [1/3]

std::vector<byte> IDEA::Encrypt ( const std::string &  password,
const byte *  buffer,
const std::size_t  buffSize 
)
overridevirtual

Encrypts buffer with password

Parameters
passwordEncryption password
bufferBuffer to encrypt (text, binary...) an array of bytes
Returns
Cipher with Enigma meta data
Exceptions
throwsCryptoPP::Exception, std::exception on failure

Implements Algorithm.

◆ Encrypt() [2/3]

void IDEA::Encrypt ( const std::string &  password,
const fs::path &  in_filename,
const fs::path &  out_filename 
)
overridevirtual

Encrypts a file with password

Parameters
passwordEncryption password
in_filenameFilename to encrypt
out_filenameFilename to store encrypted cipher
Exceptions
throwsCryptoPP::Exception, std::exception on failure

Implements Algorithm.

◆ Encrypt() [3/3]

std::vector<byte> IDEA::Encrypt ( const std::string &  password,
const std::vector< byte > &  buffer 
)
overridevirtual

Implements Algorithm.


The documentation for this class was generated from the following file: