I have a two mails (SMIME encrypted) for a single recipient. One mail is encrypted using 3DES, the other one is encrypted using AES 256.
The mails where created using C# EnvelopedCms class.
I can successfully decrypt the 3DES message using
openssl smime -decrypt -in trippledes.eml -inkey keyfile.pem
However, if I try this with the AES encrypted file, OpenSSL outputs some gibberish and Fails with this comment:
Error decrypting PKCS#7 structure 4128:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:.\crypto\evp\evp_enc.c:539:
Thunderbird cannot open the mail either. But Outlook 2010 has no problem opening the message.
What is the best way to troubleshoot the issue? Is there any logging I can turn on?
I've already examined the ASN.1 structure of both mails using the ASN.1 Decoder on http://lapo.it/asn1js/. Both messages look OK to me, so I guess the culprit lies in the encrypted Content itself.