Am getting this error "error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt". when I encrypt a buffer and persist it to writing to disk and trying to read the value from disk by decrypting it. I made sure the key, IV are same in both cases. Tried disabling or enabling padding during encryption and decryption. But still getting same error.
The thing is when I try to decrypt the value before writing to extended attributes, the decryption was a success.
Am using AES256 symmetric cipher related EVP functions.
What other things that I need to verify here?