Arrange code
This commit is contained in:
parent
5783bf5e10
commit
ecda75a273
2 changed files with 23 additions and 18 deletions
|
@ -26,7 +26,7 @@ AESCrypt::~AESCrypt(){
|
|||
|
||||
|
||||
|
||||
//Encrypt string
|
||||
//Encrypt string with string key
|
||||
std::string AESCrypt::encrypt(std::string key, std::string data){
|
||||
|
||||
//Generate SHA-256
|
||||
|
@ -36,14 +36,13 @@ std::string AESCrypt::encrypt(std::string key, std::string data){
|
|||
return encryptRoutine(data, digest, sizeof(digest));
|
||||
|
||||
}
|
||||
//Encrypt string
|
||||
|
||||
//Encrypt string with byte* key
|
||||
std::string AESCrypt::encrypt(byte* key, std::string data){
|
||||
|
||||
return encryptRoutine(data, key, 32);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//The encryptRoutine
|
||||
std::string AESCrypt::encryptRoutine(std::string data, byte* digest, int size){
|
||||
//Contain data encrypted
|
||||
std::string cipher;
|
||||
|
@ -79,14 +78,6 @@ std::string AESCrypt::encryptRoutine(std::string data, byte* digest, int size){
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Decrypt string
|
||||
std::string AESCrypt::decrypt(std::string key, std::string data){
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue