.. _program_listing_file_include_global_Crypto_PDJE_Crypto.hpp: Program Listing for File PDJE_Crypto.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/global/Crypto/PDJE_Crypto.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "PDJE_LOG_SETTER.hpp" #include #include #include #include #include namespace PDJE_CRYPTO { namespace fs = std::filesystem; class Hash { private: std::unique_ptr hashEngine; public: Hash(); ~Hash() = default; std::string TextHash(const std::string &txt); std::string FileHash(const fs::path &fp); }; class PSK { public: std::vector psk; bool Gen(const std::string &algo = "AES-256/GCM"); PSK(); ~PSK() = default; std::string Encode(); bool Decode(const std::string &hex); }; class AEAD { private: Botan::AutoSeeded_RNG rng; std::unique_ptr enc; std::unique_ptr dec; public: std::string Encrypt(std::string &noncestr, const std::string &plaintxt); std::string Decrypt(const std::string &nonce, const std::string &hexenc); std::string EncryptAndPack(const std::string &plaintxt); std::string UnpackAndDecrypt(const std::string &aead_json); AEAD(PSK &key, const std::string &algo = "AES-256/GCM"); ~AEAD() = default; }; }; // namespace PDJE_CRYPTO