Suped

Does DKIM prevent email modification in transit?

Yes, it does. In fact, one of the primary functions of DomainKeys Identified Mail (DKIM) is to act as a cryptographic check to ensure that an email's content has not been altered since it was sent. Think of it as a tamper-evident seal on a package. If the seal is broken, you know someone has interfered with the contents, even if you don't know who or why.

As Abnormal Security puts it, DKIM is designed to ensure emails “aren't altered during transit”. This integrity check is fundamental to building trust in email communications.

How does DKIM detect modifications?

DKIM's magic lies in public-key cryptography. When an email is sent from a DKIM-enabled server, a process kicks off to create a unique digital signature. Here’s a simplified breakdown:

  • Hashing: The sending server takes specific parts of the email, including chosen headers (like the From, To, and Subject lines) and the body of the message, and creates a unique, fixed-length string of text called a hash.
  • Signing: This hash is then encrypted using a private key that only the sending server knows. The resulting encrypted hash is the DKIM signature, which gets added to the email's headers.
  • Verification: When the email arrives at its destination, the receiving server looks up the sender's public key, which is published in their DNS records. It uses this public key to decrypt the signature back into the original hash. The receiver then computes its own hash of the message content. If the two hashes match, the email is considered authentic and unaltered.
luxsci.com logo
LuxSci says:
Visit website
DKIM uses asymmetric encryption for signing email messages. This validates the sender's identity and ensures the message contents are not altered in transit.

If any part of the signed content—even a single character—is changed in transit, the hash calculated by the receiving server will not match the decrypted hash from the signature. This mismatch causes the DKIM check to fail, signaling that the message has been tampered with.

Suped DMARC monitor
Free forever, no credit card required
Get started for free
Trusted by teams securing millions of inboxes
Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo

What are the limitations?

While DKIM is excellent at detecting changes, it's important to understand it doesn't physically prevent modifications. An attacker could still intercept and alter an email. DKIM simply ensures that such alterations are detectable by the recipient's mail server. The decision on what to do with a message that fails a DKIM check is up to the receiving server.

Furthermore, not all modifications are malicious. The sensitivity of DKIM means that sometimes legitimate changes can cause it to fail.

www.duocircle.com logo
DuoCircle says:
Visit website
Inadvertent modifications happen in transit, which triggers emails to fail DKIM authentication even if a malicious entity hasn't altered them.

This can happen when an email passes through an intermediary system, like a mailing list server or a corporate email gateway. These systems often add footers (like an "unsubscribe" link), modify subject lines, or otherwise adjust the content, which in turn breaks the original DKIM signature.

Why DMARC is the crucial next step

This is where DMARC (Domain-based Message Authentication, Reporting, and Conformance) comes in. DKIM provides the signal that an email might have been modified, but DMARC provides the policy. A DMARC record is a DNS entry you publish that tells receiving mail servers what to do if an email claiming to be from you fails its SPF and/or DKIM checks.

By using DKIM alongside SPF and DMARC, you create a robust authentication framework. You not only sign your emails to prove their integrity (DKIM) and specify which servers are allowed to send on your behalf (SPF), but you also give clear instructions on how to handle failures (DMARC). This combination is the industry standard for protecting your domain from spoofing and ensuring recipients can trust the emails they receive from you.

So, to conclude, DKIM is a vital technology for detecting email modifications. It provides a cryptographic method for verifying that an email's content and key headers have not been tampered with since they were signed by the sender. While it has limitations and can be broken by legitimate intermediaries, its role as a core component of modern email authentication is undeniable.

Start improving your email deliverability today

Get started