I'm currently trying to decrypt this text using openssl. I tried to make my own code using the example given here: Late authentication in OpenSSL GCM decryption but I still have bad results at the end. My decryption function is as follows:
void aes_decrypt(EVP_CIPHER_CTX ctx, unsigned char *pCipherText, int pCipherTextLen, int AADLen, unsigned char* pKey, unsigned char* pIv, unsigned char* pMac, int MacLen) { int bytesProcessed = 12; int dec_success; } unsigned char * pOut = malloc(pCipherTextLen); unsigned char * pAAD = malloc(AADLen); unsigned char * pClearText = malloc(pCipherTextLen);
All data, except AAD, is indicated earlier, while reading text files (I have a list of encrypted data, the / Iv, MAC key used and the expected result after decryption) After several experiments, the following problems occur: - the result is different from the expected - MAC change does not affect result (cleartext) - AAD suppression does not affect the results.
I really don't know why this is not working. If you have any ideas, tips or a concrete example, this will be a great help.
Best wishes
source share