Encryption/Decryption Routines AES
-
Hello to everybody, I tried to use the implementation of George Anescu[^] for encoding some text but I'm not sure I encrpyt correctly the data..... datas are taken from a buffer and are in plaintext, I allocate a buffer using
char *buffer_in=(char*)calloc(strlen(mainbuffer)+1,sizeof(char)); char *buffer_out=(char*)calloc(strlen(mainbuffer)+1,sizeof(char));
and the encrpyt it usingoRijndael.MakeKey(key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",16,16); oRijndael.Encrypt(buffer_in, *buffer_out, lenght,2); //2 = CFB
where lenght is strlen(mainbuffer)+1; when I've executedoRijndael.Encrypt(....)
I've got into buffer_out the data encrypted, but using strlen I get a lenght < of buffer_in, should I use _msize? the problem is that usingoRijndael.Decrypt
I've a lenght that's not the one of buffer_in,so Decrypt fails... Hope someone has used this implementation of AES and can help me, thanks Paolo