Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is DKIM?

DKIM attaches a cryptographic signature to outgoing email so a receiver can confirm the message came from the claimed domain and was not altered in transit.

Illustration for the cybersecurity term DKIM
Home / Blog / Cybersecurity Terms / What Is DKIM?
17 November 2026

What Is DKIM?

What Is DKIM?

DomainKeys Identified Mail, specified in RFC 6376, adds a digital signature to an email so that any receiver can verify two things: that the message was authorised by the domain that signed it, and that the signed parts have not been modified since. The private key sits on the sending infrastructure; the public key is published in DNS. Unlike SPF, which authorises sending addresses, DKIM travels with the message, so it survives a hop that SPF would not.

What a Signature Covers

The sending server adds a DKIM-Signature header containing, among other tags, the signing domain d=, the selector s=, the list of signed headers h=, a hash of the body bh=, and the signature itself b=. A receiver reads the domain and selector, fetches the public key from <selector>._domainkey.<domain>, and checks both hashes.

The h= tag deserves attention. Only the headers it names are protected. Sign From, Subject, Date, To, and Message-ID at minimum. If From is unsigned the signature is close to meaningless, and if Subject is unsigned an on-path attacker can rewrite it without breaking anything. A known trick, DKIM header injection, adds a second copy of a signed header, which some verifiers handle differently from some mail clients; listing a header twice in h= prevents the addition of an extra instance.

Body canonicalisation also matters. The relaxed mode tolerates whitespace changes in transit and is what nearly everyone uses; simple breaks easily.

Publishing the Key

A selector record is an ordinary TXT record:

sel2026._domainkey.example.co.uk. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq...IDAQAB"

Selectors exist so that one domain can run several signing systems and rotate keys without downtime. Give each platform its own selector — your mail platform, your marketing tool, your ticketing system — and name them so a human can tell what they belong to.

Key length is a live issue. RFC 8301 prohibits keys shorter than 1,024 bits and recommends 2,048, which is now the default on most platforms. Several providers still issue 1,024-bit keys, and a few older systems cannot store a 2,048-bit key in a single TXT string, which is a configuration problem rather than a reason to accept weak keys. Ed25519 signing is defined in RFC 8463 and produces short records, though verifier support remains partial, so it is published alongside an RSA selector rather than instead of one.

Rotation and Key Hygiene

Keys get forgotten. A selector published for a marketing platform you stopped using three years ago is a live signing authority for your domain in the hands of a third party. Inventory every selector in your DNS, confirm which system owns each, and remove the orphans.

Rotate on a schedule, typically every six to twelve months, using a pre-publish approach: publish the new selector, switch the signing system to it, wait beyond the longest plausible delivery delay, then remove the old record. Revoke a selector by replacing the p= value with an empty string rather than deleting the record, which tells verifiers the key was withdrawn deliberately.

How DKIM Feeds DMARC

On its own, a valid DKIM signature says only that someone with the key signed the message. It does not require the signing domain to match the visible From address, so an attacker can sign their own message with their own domain perfectly validly. DMARC supplies the missing requirement by demanding alignment between the d= domain and the From domain, and by telling receivers what to do when neither SPF nor DKIM aligns.

That is the practical sequence for any organisation: sign everything with DKIM, publish SPF for every sending source, then publish DMARC and read the aggregate reports until every legitimate stream is aligned. Only then move to enforcement. Forwarding breaks SPF but usually preserves DKIM, which is precisely why DMARC accepts either, and why ARC exists for the cases where a list server modifies the body and breaks the signature too.

Our Email Security Solutions cover selector inventory, key rotation, and the route to DMARC enforcement.

FAQ – Frequently Asked Questions

Does DKIM Encrypt My Email?

No. DKIM signs, it does not encrypt. Anyone who intercepts the message can still read it; the signature only proves the signed parts were not altered and that the signing domain authorised the message. Transport encryption between servers is a separate concern handled by STARTTLS with MTA-STS or DANE, and end-to-end confidentiality needs S/MIME or PGP.

What Key Length Should I Use for DKIM?

Use 2,048-bit RSA. RFC 8301 forbids anything below 1,024 bits and recommends 2,048, and 1,024-bit keys are considered weak for long-lived signing. If a platform insists it cannot store a 2,048-bit key, that is a limitation to raise with the vendor. Ed25519 keys are shorter and supported by RFC 8463, but verifier coverage is still incomplete.

Why Does DKIM Fail After Forwarding?

Simple forwarding usually preserves the signature, because the signed headers and body are unchanged. Mailing lists break it when they rewrite the subject line or append a footer, since both alter signed content. This is exactly the case ARC was designed for, allowing the forwarder to record and seal the authentication result it saw before modifying the message.

How Often Should DKIM Keys Be Rotated?

Every six to twelve months is a reasonable cadence, and immediately if a signing system is compromised or a supplier relationship ends. Use a pre-publish rollover: publish the new selector, switch signing to it, wait past the longest expected delivery delay, then revoke the old one by emptying its p tag rather than deleting the record.

Related Terms

You May Be Interested In These

What Is Confidential Computing?

Cybersecurity Terms

17 November 2026

What Is Confidential Computing?

Read More
What Is Local and Remote File Inclusion?

Cybersecurity Terms

17 November 2026

What Is Local and Remote File Inclusion?

Read More