← RFC Reference

RFC 5751: S/MIME 3.2 Message Specification

Standards Track Content Security Published January 2010
ELI5: TLS encrypts email in transit — like an armored truck carrying your letter between post offices. But at each post office, the letter is unloaded and readable. S/MIME encrypts the letter itself. Only the intended recipient, holding the right key, can open and read it. Even the mail servers in between can’t peek inside. It also lets you digitally “wax seal” your letter so the recipient can prove it came from you and wasn’t tampered with.

Why This Exists

Transport-layer security (TLS, STARTTLS) protects email between hops, but it has limits:

S/MIME provides end-to-end encryption (only the recipient can decrypt) and digital signatures (the recipient can verify the sender's identity and that the content wasn't altered). It uses X.509 certificates from the same PKI that secures HTTPS.

How It Works

The Two Operations

S/MIME wraps standard MIME messages in cryptographic envelopes using CMS (Cryptographic Message Syntax):

Operation What It Does MIME Type
Signing Proves sender identity and message integrity multipart/signed or application/pkcs7-mime (opaque)
Encryption Encrypts content so only the recipient can read it application/pkcs7-mime (enveloped-data)

You can sign only, encrypt only, or sign-then-encrypt (the most common combination).

Signing a Message

The sender uses their private key to create a digital signature over the message content. Two formats exist:

-- Clear-signed message structure --
Content-Type: multipart/signed;
  protocol="application/pkcs7-signature";
  micalg=sha-256; boundary="----sig"

------sig
Content-Type: text/plain

This is the original message content.
It is readable by any email client.

------sig
Content-Type: application/pkcs7-signature
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBgl...
(base64-encoded CMS SignedData)
------sig--

Encrypting a Message

The sender encrypts using the recipient's public key (from their X.509 certificate). Only the recipient's corresponding private key can decrypt:

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

MIAGCSqGSIb3DQEHA6CAMIA...
(base64-encoded CMS EnvelopedData)

In practice, S/MIME uses hybrid encryption: a random symmetric key (e.g., AES-128-CBC) encrypts the message, and the recipient's RSA/EC public key encrypts that symmetric key.

Key Technical Details

Certificate Requirements

S/MIME relies on X.509 certificates issued by a Certificate Authority (CA). The certificate must:

This is the biggest practical barrier to S/MIME adoption: every sender needs a certificate, and every recipient needs the sender's public certificate to verify signatures or send encrypted replies.

Algorithm Requirements (S/MIME 3.2)

Purpose MUST Support SHOULD Support
Signing (digest) SHA-256 SHA-384, SHA-512
Signing (key) RSA DSA, ECDSA
Encryption (content) AES-128-CBC AES-192-CBC, AES-256-CBC
Key transport RSA ECDH

SHA-1 and 3DES are still referenced for backward compatibility but are considered weak. S/MIME 4.0 updates these requirements significantly.

Certificate Discovery

For encryption, the sender needs the recipient's certificate. Common discovery methods:

Common Mistakes

Deliverability Impact

Related RFCs