summaryrefslogtreecommitdiff
path: root/CryptClass/AESCrypt.hpp
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-09 12:51:23 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-09 12:51:23 +0400
commit7d2c4734224eb7f6cf699bc84f505c06c4394b35 (patch)
tree070330590915595ec740acfeea5a92c742f427fb /CryptClass/AESCrypt.hpp
parent1574c191c3a6909e2b932fb32d6c63dc89e264b1 (diff)
AES first release. Add method to HASHCrypt class.
Diffstat (limited to 'CryptClass/AESCrypt.hpp')
-rw-r--r--CryptClass/AESCrypt.hpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/CryptClass/AESCrypt.hpp b/CryptClass/AESCrypt.hpp
index e69de29..a8fa976 100644
--- a/CryptClass/AESCrypt.hpp
+++ b/CryptClass/AESCrypt.hpp
@@ -0,0 +1,71 @@
+/**
+ * @file AESCrypt.hpp
+ * @brief AESCrypt class header
+ * @author manzerbredes
+ * @date 8 Mars 2015
+ *
+ * Contain all prototypes of AESCrypt class.
+ *
+ */
+
+//----- std -----
+#include "AbstractSKA.hpp"
+#include "HASHCrypt.hpp"
+#include <iostream>
+
+//----- crypto++ -----
+#include <crypto++/aes.h>
+#include <crypto++/modes.h>
+#include <crypto++/filters.h>
+
+
+/**
+ * @class AESCrypt AESCrypt.hpp "/CryptClass/AESCrypt.hpp"
+ * @brief Class for Advanced Encryption Standard (AES) algorithm
+ * @author manzerbredes
+ *
+ * This class provide AES encrypt and decrypt.
+ *
+ */
+
+class AESCrypt : public AbstractSKA {
+
+
+ public:
+ AESCrypt();
+ ~AESCrypt();
+
+
+ /**
+ * @brief Encrypt data with AES algorithm.
+ *
+ * @param key : key to encrypt data
+ * @param data : contain data to encrypt.
+ *
+ * @return string : correspond to crypted data
+ *
+ * Encrypt data, and return them in a string.
+ * Padding are blank space.
+ *
+ */
+ virtual std::string encrypt(std::string key, std::string data);
+
+ /**
+ * @brief Decrypt data from AES algorithm.
+ *
+ * @param key : key used to encrypt data
+ * @param data : contain data to decrypt from AES encrypt.
+ *
+ * @return string : correspond to decrypted data
+ *
+ * Decrypt data, and return them in a string.
+ * Padding is not removed.
+ *
+ */
+ virtual std::string decrypt(std::string key, std::string data);
+
+ private:
+ HASHCrypt hash; ///< hash instance to generate SHA-256 hash code.
+
+
+};