When a sender S/MIME-encrypts a message to a colleague, whose key protects it, whose private key opens it, and what stays readable in transit?
answer
- who must be able to read it
- a public key from a certificate
- a copy for the sender too
- Subject and To outside the protection
basics
~20 sS/MIME encryption uses each recipient's certificate to protect a random content key, which only that recipient's private key can recover. Body and attachments are hidden end to end; the envelope and outer headers such as From, To and Subject stay readable.
solid answer
~40 sThe sender's client generates a random content-encryption key, encrypts the body once with it, and protects a copy of that key with each recipient's public key, taken from the recipient's certificate. Only the matching private key, held by that recipient, recovers the copy and so the body. RFC 8551 adds that a copy SHOULD also be encrypted for the originator, which is how the sender can reread the message later. What is protected is the MIME entity: body and attachments. The SMTP envelope and outer header fields (`From`, `To`, `Cc`, `Subject`) stay readable to every relay and mailbox store, unless the client wraps the whole message in a `message/rfc822` entity first, and even then an outer header still travels for delivery. Decrypting successfully does not prove who sent the message; that takes a signature.
go deeper
Recall the direction: encryption uses each recipient's certificate and only that recipient's private key opens it. Be ready to say that the Subject line and addresses are not hidden.
Explain the random content key used once for the body, the per-recipient wrapped copies, and the originator copy RFC 8551 says a client SHOULD add so the sender can reread sent mail.
Show the operational consequences: users need a certificate for every recipient plus one of their own, header text leaks unless wrapped, and successful decryption is no evidence of the sender.
Frame where message-level encryption earns its cost over transport security alone: stored copies stay protected at every server, paid for with certificate distribution and key custody for every user.
## What S/MIME encryption is for S/MIME (Secure/MIME, version 4.0 in RFC 8551) protects **the message itself** rather than the connection it travels over. When a message is encrypted, the protected content is wrapped in a Cryptographic Message Syntax (CMS) structure, `EnvelopedData` or, since 4.0, `AuthEnvelopedData`, and sent as an `application/pkcs7-mime` body. Every relay and mailbox store on the way holds the content only as ciphertext; only the people the sender addressed can turn it back into readable text. That end-to-end property is the reason to use it. Encryption on each SMTP hop protects a message while it moves between two servers, but each server then holds it in readable form; that hop-by-hop layer is covered with SMTP transport security. ## Whose key does what The rule confident answers most often get backwards: **encryption is done for the reader, so it uses the reader's key.** | Step | Key used | Whose | |---|---|---| | Protect the content key | Public key in the recipient's certificate | The recipient's | | Recover the content key | Private key matching that certificate | The recipient's, held only by them | | Encrypt the body | A random content-encryption key | Generated by the sender's client for this one message | | Sign the message (a separate operation) | Private key | The sender's | A sender therefore needs a certificate **for every recipient** before it can encrypt to them, and a recipient must hold their own private key to read the message. How a sender obtains a correspondent's certificate is a separate subject, certificate discovery and trust. ## How one message reaches several readers The sender's client does not encrypt the body separately for each person. It follows the CMS steps: 1. Generate a random **content-encryption key** (CEK). 2. Protect a copy of the CEK for each recipient with that recipient's public key, and record it, with an identifier of the recipient's certificate, in a per-recipient entry called a `RecipientInfo`. 3. Encrypt the body once with the CEK. 4. Send the encrypted body and all the per-recipient entries together. A recipient's client finds the entry meant for its user, recovers the CEK with the user's private key and decrypts the body. ## The sender's own copy RFC 8551 says a copy of the CEK **SHOULD** also be encrypted for the originator and included in the message. That extra entry is what lets the sender reopen the message later from their sent-mail folder; without it, the stored copy is readable only by the recipients. In practice the sender also needs an encryption certificate of their own. ## What is hidden and what is not S/MIME secures a MIME entity: the body and its attachments. It does not by default protect the outer header fields or the SMTP envelope, which relays need for delivery. - **Hidden:** the body text, the attachments and their file names, and anything else inside the protected entity. - **Readable to relays and mailbox stores:** the envelope sender and recipients, and outer header fields such as `From`, `To`, `Cc`, `Date` and `Subject`. - **Optional header protection:** RFC 8551 lets a sending client wrap the whole message, headers included, in a `message/rfc822` entity before encrypting. A protected copy of the headers then travels inside, but an outer, unprotected header still travels for delivery, and how the two are shown is up to the receiving client. - **Rough size:** the ciphertext length follows the content length, so the approximate size of the message stays visible. An organisation's policy should say plainly that confidential text does not belong in the subject line. ## When it goes wrong Most encryption help-desk tickets trace back to which key is where: - **"I can't encrypt to this person"** — the sender's client holds no certificate for that recipient, so it has no public key to protect the content key with. - **"I can't open this on my new laptop"** — the private key matching the certificate the message was encrypted to is not on that device; moving and keeping keys is a key-custody matter. - **"I can't read what I sent"** — the client did not add the originator copy, or the sender holds no encryption certificate of their own. - **"Only some recipients can read it"** — each recipient's copy depends on that recipient's own private key, so one person's missing key affects only them. ## What encryption does not tell the recipient A message that decrypts correctly shows only that it was encrypted to the recipient's certificate, and that certificate is public by design: anyone holding it could have produced the message. RFC 8551 credits `EnvelopedData` with confidentiality and states that `AuthEnvelopedData` provides neither authentication nor non-repudiation. To show who wrote a message, the sender signs it with their own private key, a separate operation that is usually combined with encryption.
- Why can the sender still read an S/MIME-encrypted message in their own sent-mail folder?Because RFC 8551 says the sending client SHOULD also encrypt a copy of the content key for the originator, using the sender's own encryption certificate, and include it as one more per-recipient entry. Without that entry the stored copy is readable only by the recipients, and the sender would need some other copy to reread it.
- If the Subject line holds confidential text, does S/MIME encryption protect it?Not by default: encryption covers the MIME entity, not the outer header fields. RFC 8551 lets a sending client wrap the full message, headers included, in a message/rfc822 entity before encrypting, so a protected copy travels inside, but an outer unprotected header still travels for delivery and the receiving client decides how to show both. Policy should keep confidential text out of subject lines.
- Does a message that decrypts correctly prove who sent it?No. A recipient's certificate is meant to be public, so anyone holding it can encrypt to that recipient. RFC 8551 credits EnvelopedData with confidentiality and says AuthEnvelopedData provides neither authentication nor non-repudiation. Showing the author takes an S/MIME signature made with the sender's private key.
An encrypted S/MIME message is one locked box with a separate copy of the box key for each recipient, each copy sealed so that only that recipient's own private key opens it; the address label on the outside of the box stays readable to every courier.
- The sender encrypts the message with their own private key.
- S/MIME encryption hides the Subject line and the recipient addresses from mail servers.
- A message that decrypts correctly proves who sent it.
- Sender and recipient must agree a shared password before S/MIME encryption works.
- Once TLS protects every SMTP hop, S/MIME encryption adds nothing.