blob: 4a0845c6c8aa563118ffb2cfae24e616d5de2ca0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/**
* @file AESCrypt.hpp
* @brief AESCrypt class header
* @author manzerbredes
* @date 8 Mars 2015
*
* Contain all prototypes of AESCrypt class.
*
*/
#ifndef __AESCrypt__
#define __AESCrypt__
//----- 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 used 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 into a string.
*
*/
virtual std::string decrypt(std::string key, std::string data);
private:
HASHCrypt hash; ///< hash instance to generate SHA-256 hash code.
};
#endif
|