I am using encrypt/decryptCBC( ), the library works fine up to 32 bit data, but greater than 32 i.e. 48 bit restarts my esp8266 after 20 seconds. what is the problem. please help me.
My code.(I have changed encryptCBC()/decryptCBC() from private to public in library.)
//performing multiple of 16 bit encryption/decryption
include
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println();
char encrypted[]="";
char Decrypted[]="";
int Datalength=0;
const uint8_t keyEnc[]={1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8};
const uint8_t iv[]={1,1,1,1,1,1,2,2,2,2,3,3,4,4,7,7};
char data[]="Encrpt me otherwise y'll lose me got it $$$4$$";
Datalength=sizeof(data);
AES AesEncrypt( keyEnc,iv,AES::AES_MODE_128, AES::CIPHER_ENCRYPT);//passing four values to the constructor of class AES,here we select AES mode
//128bit/256bit, and select encryption or decryption
AES AesDecrypt( keyEnc,iv,AES::AES_MODE_128, AES::CIPHER_DECRYPT);
I am using encrypt/decryptCBC( ), the library works fine up to 32 bit data, but greater than 32 i.e. 48 bit restarts my esp8266 after 20 seconds. what is the problem. please help me.
My code.(I have changed encryptCBC()/decryptCBC() from private to public in library.)
//performing multiple of 16 bit encryption/decryption
include
void setup() { // put your setup code here, to run once: Serial.begin(9600);
Serial.println(); char encrypted[]=""; char Decrypted[]=""; int Datalength=0; const uint8_t keyEnc[]={1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8}; const uint8_t iv[]={1,1,1,1,1,1,2,2,2,2,3,3,4,4,7,7}; char data[]="Encrpt me otherwise y'll lose me got it $$$4$$"; Datalength=sizeof(data); AES AesEncrypt( keyEnc,iv,AES::AES_MODE_128, AES::CIPHER_ENCRYPT);//passing four values to the constructor of class AES,here we select AES mode //128bit/256bit, and select encryption or decryption AES AesDecrypt( keyEnc,iv,AES::AES_MODE_128, AES::CIPHER_DECRYPT);
AesEncrypt.encryptCBC((uint8_t) data,(uint8_t)encrypted,Datalength); delay(200); Serial.println(); Serial.println(); for(int i=0; i<Datalength;i++) Serial.print(encrypted[i]); Serial.println(); AesDecrypt.decryptCBC((uint8_t)encrypted,(uint8_t)Decrypted,Datalength); delay(200); //Decrypted =(String)&data[0]; for(int i=0; i<Datalength;i++) Serial.print(Decrypted[i]); Serial.println(); Serial.println(Datalength);
}
void loop() { // put your main code here, to run repeatedly:
}