summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-09 13:01:13 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-09 13:01:13 +0400
commit760fc160762852896865ca4cbc12cf8153c9c4cc (patch)
tree5bb44cf27ac780790762487a91686c4056c7fec9
parent00ef6a8d293b8b0811dee4a83a8ab689e1c00eab (diff)
Remove useless includes and comments.
-rw-r--r--CryptClass/AESCrypt.cpp19
-rw-r--r--CryptClass/HASHCrypt.hpp1
-rw-r--r--main.cpp12
3 files changed, 12 insertions, 20 deletions
diff --git a/CryptClass/AESCrypt.cpp b/CryptClass/AESCrypt.cpp
index 78a553e..08f00f2 100644
--- a/CryptClass/AESCrypt.cpp
+++ b/CryptClass/AESCrypt.cpp
@@ -9,7 +9,7 @@
*/
#include "AESCrypt.hpp"
-#include <iomanip>
+
//Constructor
AESCrypt::AESCrypt(){
this->hash=HASHCrypt(); //Init hash attribute
@@ -27,23 +27,6 @@ std::string AESCrypt::encrypt(std::string key, std::string data){
byte digest[32];
hash.getSHA_256(key, digest, (int)sizeof(digest));
-
-
-
- //Add padding for AES
- /*char pad=0x01;
- int tmpL=data.length();
- while(tmpL % 128 != 0){
- tmpL++;
- pad+=1;
-
- }
- std::cout << "pad:"<< std::hex << pad;
- while(data.length() % 128 != 0){
- data+=pad;
- }
-
- std::cout << data.length();*/
//Contain data encrypted
std::string cipher;
diff --git a/CryptClass/HASHCrypt.hpp b/CryptClass/HASHCrypt.hpp
index b4b02fd..b377fac 100644
--- a/CryptClass/HASHCrypt.hpp
+++ b/CryptClass/HASHCrypt.hpp
@@ -21,7 +21,6 @@
#include <crypto++/md5.h> //For MD5
#include <crypto++/hex.h> //For Hex convertion
#include <crypto++/sha.h> //For SHA
-#include <crypto++/modes.h>
/**
diff --git a/main.cpp b/main.cpp
index b65d5ba..7a218d0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -33,8 +33,18 @@
*/
int main(int argc, char *argv[]){
+ std::string chaine="It's work !";
+
+ AESCrypt aes;
+
+ chaine=aes.encrypt("loic", chaine);
+
+ std::cout << chaine << std::endl;
+
+ chaine=aes.decrypt("loic", chaine);
+
+ std::cout << chaine << std::endl;
- std::cout << "It's work !" << std::endl;
return 0;