Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
Blowfish.hpp
Go to the documentation of this file.
1 #pragma once
3 
8 class Blowfish : public Algorithm {
9  public:
13  explicit Blowfish(const Algorithm::Intent intent) noexcept;
14  ~Blowfish() noexcept override;
15 
16  public:
17  std::vector<byte> Encrypt(const std::string& password, const byte *buffer, const std::size_t buffSize) override;
18  std::vector<byte> Encrypt(const std::string& password, const std::vector<byte>& buffer) override;
19  std::vector<byte> Decrypt(const std::string& password, const byte *cipher, const std::size_t cipherSize) override;
20  std::vector<byte> Decrypt(const std::string& password, const std::vector<byte>& cipher) override;
21  void Encrypt(const std::string& password, const fs::path& in_filename, const fs::path& out_filename) override;
22  void Decrypt(const std::string& password, const fs::path& in_filename, const fs::path& out_filename) override;
23 
24  private:
25  std::unique_ptr<CryptoPP::EAX<CryptoPP::Blowfish>::Encryption> m_blowfish_encryptor;
26  std::unique_ptr<CryptoPP::EAX<CryptoPP::Blowfish>::Decryption> m_blowfish_decryptor;
27 };
28 
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Algorithm abstract class.
Definition: Algorithm.hpp:53
std::vector< byte > Decrypt(const std::string &password, const byte *cipher, const std::size_t cipherSize) override
std::vector< byte > Encrypt(const std::string &password, const byte *buffer, const std::size_t buffSize) override
~Blowfish() noexcept override
Blowfish(const Algorithm::Intent intent) noexcept