DKIM
What is DKIM?
DKIMAn email authentication standard defined in RFC 6376 that lets a sending domain add a cryptographic signature to outgoing messages so receivers can verify that headers and body were not altered.
DomainKeys Identified Mail (DKIM) is specified in RFC 6376. The sending Mail Transfer Agent computes a hash over selected headers (chosen with the h= tag — typically From, Subject, Date) and the body, signs it, and adds a DKIM-Signature: header naming the signing domain (d=) and selector (s=). Receivers fetch the public key from <selector>._domainkey.<domain> (a DNS TXT record) and verify the signature. Because it protects content rather than the transport path, DKIM survives most forwarding, and it provides the cryptographic identifier that DMARC aligns against.
Real-world failures
Key length is not optional. In 2012 researcher Zachary Harris found Google signing with a factorable 512-bit RSA key; he cracked it for roughly $75 of cloud compute and mailed a forgery to Larry Page "from" Sergey Brin. eBay, Yahoo, Twitter and Amazon shared the weakness, and Google upgraded to 2048-bit within days. RFC 8463 (2018) added the compact, fast Ed25519-SHA256 algorithm, but many mailbox providers still validate only RSA, so operators publish both under separate selectors.
A subtler abuse is the DKIM replay attack: because DKIM carries no delivery history, an attacker who obtains one validly signed message from a high-reputation domain can resend it to thousands of victims and the signature still verifies, borrowing the domain's reputation. Defences include oversigning critical headers, avoiding the body-length l= tag, setting an expiry with the x= tag, and rotating keys regularly (per M3AAWG guidance).
flowchart LR
A[Sender MTA] -->|hash headers+body,<br/>sign with private key| B[Add DKIM-Signature header]
B --> C[Message in transit]
C --> D[Receiver MTA]
D -->|query selector._domainkey TXT| E[(DNS public key)]
E --> D
D -->|recompute hash,<br/>verify signature| F{Valid & unaltered?}
F -->|Yes| G[Pass - feeds DMARC alignment]
F -->|No| H[Fail - DMARC decides fate]● Examples
- 01
An outbound mail server signs marketing emails with selector s1 and key d=example.com, allowing DMARC alignment.
- 02
Rotating a DKIM key by publishing a new selector before retiring the old one to avoid validation gaps.
● Frequently asked questions
What is DKIM?
An email authentication standard defined in RFC 6376 that lets a sending domain add a cryptographic signature to outgoing messages so receivers can verify that headers and body were not altered. It belongs to the Network Security category of cybersecurity.
What does DKIM mean?
An email authentication standard defined in RFC 6376 that lets a sending domain add a cryptographic signature to outgoing messages so receivers can verify that headers and body were not altered.
How do you defend against DKIM?
Defences for DKIM typically combine technical controls and operational practices, as detailed in the full definition above.
What are other names for DKIM?
Common alternative names include: DomainKeys Identified Mail.