Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if encrypted S/MIME message is also signed, without decrypting it

What is the easiest way (in terms of computing resources) to tell if an s/mime email message is signed with attached signature when this message is encrypted?

If a message is just signed, it's easy. It has somewhat like:

for attached signature

   Content-Type: application/x-pkcs7-mime; smime-type=signed-data;
    name="smime.p7m"

Or:

for detached signature

   Content-Type: multipart/signed; protocol="application/x-pkcs7-signature";
    micalg=SHA1; boundary="----=_NextPart_000_00D2_01CD5850.61030BF0"

in its headers.

But when a message is encrypted, you can't tell if it's also signed because the Content-Type header is the same for both cases (just encrypted and encrypted/signed):

  Content-Type: application/x-pkcs7-mime;
    smime-type=enveloped-data;
    boundary="----=_NextPart_000_000D_01CDC82B.98454D80";
    name="smime.p7m"

Does it mean that I have to decrypt the message just to tell if it's also signed? For now, it seems I cannot even tell if my message is signed before I decrypt it (because the signature is within the encrypted data). Or, maybe, S/MIME encrypted and signed data still has some pattern which could let me distinguish between encrypted/signed and encrypted/unsigned data without decryption (which may even be possible if I don't have the certificate for decryption)?

like image 965
Alex Avatar asked Nov 22 '12 11:11

Alex


People also ask

How do you check if S MIME is enabled?

In the Outlook menu, under Tools, choose Accounts and select your Exchange account. Click on the Advanced tab then select the Security tab. Look to see if you have a certificate listed in the "Digital Signing" and "Encryption" fields. If there are certificates listed here, you are using S/MIME.

Where do I find my S MIME certificate?

Open Settings by tapping the gear icon on a PC, or the ellipsis (...) and then the gear icon on a phone. Tap Email security. In Select an account, select the account for which you want to configure S/MIME options. Make a certificate selection for digital signature and encryption.

How do you tell if a message is encrypted?

Check if a message you're sending is encryptedTo the right of your recipients, you'll see a lock icon that shows the level of encryption that is supported by your message's recipients. If there are multiple users with various encryption levels, the icon will show the lowest encryption status.

How email messages are protected using S MIME signing and encryption?

An S/MIME certificate is installed on the email clients of both the recipient and the sender. When an email is sent, the sender encrypts the email using the recipient's public key and the recipient decrypts the email using the private key. S/MIME also attaches a digital signature to an email.


1 Answers

S/MIME is flexible; you can sign and/or encrypt in any combination you want. Email clients, however, typically all behave the same way: Outlook 2010, Apple's Mail, and Thunderbird 17 all sign and then encrypt. The results for these 3 are nearly identical. They include these 3 headers in the message headers:

Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
    name="smime.p7m"
Content-Disposition: attachment; filename="smime.p7m"
Content-Transfer-Encoding: base64

They encrypt and base64-encode the entire body of the message.

To answer your questions:

What is the easiest way (in terms of computing resources) to tell if an s/mime email message is signed with attached signature when this message is encrypted?

The only way is to decrypt it.

Does it mean that I have to decrypt the message just to tell if it's also signed?

Yes.

like image 101
james.garriss Avatar answered Sep 22 '22 13:09

james.garriss