From 6ec4befb10fa6b756e966b3e769edb80e9288f4a Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Mon, 15 Jul 2024 10:36:40 +0700 Subject: [PATCH] Create qrc.cpp --- models/qrc/qrc.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 models/qrc/qrc.cpp diff --git a/models/qrc/qrc.cpp b/models/qrc/qrc.cpp new file mode 100644 index 0000000..3eddcfc --- /dev/null +++ b/models/qrc/qrc.cpp @@ -0,0 +1,37 @@ +#include +#include +#include + +class QRC { +public: + QRC() { + // Initialize the AES-256 encryption algorithm + EVP_CIPHER_CTX *ctx; + ctx = EVP_CIPHER_CTX_new(); + EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv); + } + + void encrypt_data(const char *data) { + // Encrypt the data using AES-256 + int len; + unsigned char *out; + EVP_EncryptUpdate(ctx, &out, &len, (unsigned char *)data, strlen(data)); + //... + } + + void decrypt_data(const char *data) { + // Decrypt the data using AES-256 + int len; + unsigned char *out; + EVP_DecryptUpdate(ctx, &out, &len, (unsigned char *)data, strlen(data)); + //... + } +}; + +int main() { + QRC qrc; + const char *data = "Top Secret Information"; + qrc.encrypt_data(data); + //... + return 0; +}