diff options
Diffstat (limited to 'CryptClass/AESCrypt.hpp')
| -rw-r--r-- | CryptClass/AESCrypt.hpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/CryptClass/AESCrypt.hpp b/CryptClass/AESCrypt.hpp index 5e16672..c4d75aa 100644 --- a/CryptClass/AESCrypt.hpp +++ b/CryptClass/AESCrypt.hpp @@ -28,15 +28,18 @@ * @author manzerbredes * * This class provide AES encrypt and decrypt. + * Key used is 32 bytes key (256 bits). * * \bug Find another solution for managing padding. */ - class AESCrypt : public AbstractSKA { public: + //Constructor AESCrypt(); + + //Destructor ~AESCrypt(); @@ -48,45 +51,48 @@ class AESCrypt : public AbstractSKA { * * @return string : correspond to crypted data * - * Run encryptRoutine with byte* key or string key + * Run encryptRoutine with byte* key or string key. + * Allow you to choose between string key or byte key. * */ std::string encrypt(std::string key, std::string data); std::string encrypt(byte* key, std::string data); - /** - * @brief Encrypt data with AES algorithm. + /** + * @brief Decrypt data from AES algorithm. * * @param key : key used to encrypt data - * @param data : contain data to encrypt. + * @param data : contain data to decrypt from AES encrypt. * - * @return string : correspond to crypted data + * @return string : correspond to decrypted data * - * Encrypt data, and return them into a string. - * Padding are blank space. + * Decrypt data, and return them into a string. * */ - std::string encryptRoutine(std::string data, byte* digest, int size); + std::string decrypt(std::string key, std::string data); - /** - * @brief Decrypt data from AES algorithm. + private: + + /** + * @brief Encrypt data with AES algorithm. * * @param key : key used to encrypt data - * @param data : contain data to decrypt from AES encrypt. + * @param data : contain data to encrypt. * - * @return string : correspond to decrypted data + * @return string : correspond to crypted data * - * Decrypt data, and return them into a string. + * Encrypt data, and return them into a string. + * Padding are blank space. * */ - virtual std::string decrypt(std::string key, std::string data); + std::string encryptRoutine(std::string data, byte* digest, int size); + //Attributes: - private: HASHCrypt hash; ///< hash instance to generate SHA-256 hash code. |
