diff options
| author | Dimitris <dimstav23@gmail.com> | 2025-07-15 15:11:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-15 15:11:36 +0200 |
| commit | 73e505f04d17eba36c41fce7b48bc4d6884b8fd0 (patch) | |
| tree | 44b5f4627309a48d6f22b54bb2ad9a2976e8601b /archive/2025/summer/bsc_karidas/include/Crypto.hpp | |
| parent | ca92e7ad181a02890496872012ecc6c1d08b1658 (diff) | |
| parent | d8c365681a41961ebe2daea5701a4d56f5400d1d (diff) | |
| download | research-work-archive-artifacts-73e505f04d17eba36c41fce7b48bc4d6884b8fd0.tar.gz research-work-archive-artifacts-73e505f04d17eba36c41fce7b48bc4d6884b8fd0.zip | |
Merge pull request #6 from chriskari/upload-artifacts
Add bsc_karidas
Diffstat (limited to 'archive/2025/summer/bsc_karidas/include/Crypto.hpp')
| -rw-r--r-- | archive/2025/summer/bsc_karidas/include/Crypto.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/archive/2025/summer/bsc_karidas/include/Crypto.hpp b/archive/2025/summer/bsc_karidas/include/Crypto.hpp new file mode 100644 index 000000000..53e5fa12e --- /dev/null +++ b/archive/2025/summer/bsc_karidas/include/Crypto.hpp @@ -0,0 +1,33 @@ +#ifndef CRYPTO_HPP +#define CRYPTO_HPP + +#include <vector> +#include <string> +#include <cstdint> +#include <memory> +#include <openssl/evp.h> + +class Crypto +{ +private: + EVP_CIPHER_CTX *m_encryptCtx; + EVP_CIPHER_CTX *m_decryptCtx; + +public: + Crypto(); + ~Crypto(); + + static constexpr size_t KEY_SIZE = 32; // 256 bits + static constexpr size_t GCM_IV_SIZE = 12; // 96 bits (recommended for GCM) + static constexpr size_t GCM_TAG_SIZE = 16; // 128 bits + + std::vector<uint8_t> encrypt(std::vector<uint8_t> &&plaintext, + const std::vector<uint8_t> &key, + const std::vector<uint8_t> &iv); + + std::vector<uint8_t> decrypt(const std::vector<uint8_t> &encryptedData, + const std::vector<uint8_t> &key, + const std::vector<uint8_t> &iv); +}; + +#endif \ No newline at end of file |