skip to content

Which a= algorithms may a DKIM signer use today, and why is rsa-sha1 no longer acceptable for signing or for verifying?

level: middleimportance: should knowfreq 30%

answer

  1. two algorithms in the 2011 RFC
  2. a 2018 update retired one
  3. an elliptic-curve addition the same year
  4. one selector per key record

basics

~10 s

DKIM signers use rsa-sha256, which RFC 8301 (January 2018) made mandatory, and may add ed25519-sha256 from RFC 8463 (September 2018). RFC 8301 made rsa-sha1 historic: it MUST NOT be used for signing or verifying.

solid answer

~40 s

RFC 6376 (2011) defined `rsa-sha1` and `rsa-sha256`, told verifiers to support both and told signers they SHOULD use `rsa-sha256`. RFC 8301 (January 2018) tightened that: signers MUST sign with `rsa-sha256`, `rsa-sha1` MUST NOT be used for signing or verifying, and a signature made with it has permanently failed evaluation. It also set RSA key sizes: at least 1024 bits, SHOULD be at least 2048. RFC 8463 (September 2018) added `ed25519-sha256`, with signers SHOULD and verifiers MUST implement it. Because a verifier ignores signatures with algorithms it does not implement, a signer adopting Ed25519 adds it as a second signature beside RSA, under a different selector.

go deeper

for a junior

Recall the two algorithms in use, rsa-sha256 and ed25519-sha256, and that rsa-sha1 is no longer allowed for signing or verifying.

for a middle

Explain what RFC 8301 changed in 2018, the RSA key-size floor it set, and why adding Ed25519 means a second signature under its own selector.

for a senior

Audit a domain's outgoing signatures for a retired algorithm or a short key, and explain why an Ed25519-only signer loses verification at receivers without support.

for a principal

Own the algorithm policy as a standard for every system that signs as the domain, including when Ed25519 is added and how its rollout is checked.

## What the a= tag names The required `a=` tag of a `DKIM-Signature` names the signing algorithm as two parts joined by a hyphen: the signature scheme and the hash. The hash is used for both the body hash in `bh=` and the header hash that `b=` signs. The key record published for the selector says which kind of key it holds (`k=rsa` by default, `k=ed25519` for the newer scheme); the record's tags are covered with DKIM selectors and key records. ## The history in three documents | Document | Date | What it says about algorithms | |---|---|---| | RFC 6376 | September 2011 | Defines `rsa-sha1` and `rsa-sha256`; signers MUST implement and SHOULD sign with `rsa-sha256`; verifiers MUST implement both | | RFC 8301 | January 2018 | Signers MUST sign with `rsa-sha256`; `rsa-sha1` MUST NOT be used for signing or verifying; RSA keys at least 1024 bits, SHOULD be 2048 | | RFC 8463 | September 2018 | Adds `ed25519-sha256` (PureEdDSA Ed25519 over a SHA-256 hash) and `k=ed25519`; signers SHOULD and verifiers MUST implement it | An answer that still says "verifiers must support rsa-sha1" is quoting the 2011 text that RFC 8301 replaced. ## Why rsa-sha1 went RFC 8301 calls the `rsa-sha1` algorithm **historic** and states that signatures made with it have **permanently failed evaluation**, in the sense of RFC 6376 Section 3.9. Its security section says the change resolves the SHA-1 risks discussed in RFC 6194; why those weaknesses matter for any signature is covered with hashing. The practical consequences for a mail administrator: - A signer still emitting `a=rsa-sha1` produces signatures that conforming receivers treat as failed, so the domain effectively has no DKIM signature for those receivers. - A verifier that still accepts `rsa-sha1` is out of line with the standard. - Retiring it is a configuration change on the signer: switch the algorithm and, if the key is short, generate a longer one. RFC 8301 also tightened key sizes: signers MUST use RSA keys of at least 1024 bits and SHOULD use at least 2048, and verifiers MUST NOT treat signatures from RSA keys under 1024 bits as valid. Moving a domain from 1024-bit to 2048-bit keys is covered with DKIM key rotation. ## rsa-sha256 and ed25519-sha256 side by side | | `rsa-sha256` | `ed25519-sha256` | |---|---|---| | Defined in | RFC 6376, required by RFC 8301 | RFC 8463 | | Hash | SHA-256 | SHA-256 | | Public key size | at least 1024 bits, 2048 recommended; verifiers handle up to 4096 | 256 bits, 44 octets in base64 | | Signer requirement | MUST sign with it (RFC 8301) | SHOULD implement | | Verifier requirement | MUST verify | MUST implement | Because both use SHA-256, two signatures over the same body with the same `c=` carry the same `bh=` value; the RFC 8463 example message shows exactly that. ## Signing with both RFC 6376 Section 3.3.4 says verifiers MUST **ignore** signatures that use algorithms they do not implement. A receiver that has not added Ed25519 support sees an Ed25519-only message as unsigned. RFC 8463 Section 6 therefore describes the transition: 1. Keep the `rsa-sha256` signature. 2. Add an `ed25519-sha256` signature as a second `DKIM-Signature` field. 3. Give it a **different selector**, because each selector has exactly one key record in DNS. 4. Keep the same `d=` (and `i=`, if used); each signature verifies on its own. A verifier that understands both may pass either; one that understands only RSA uses the RSA signature. ## Reviewing a signer's algorithm - Look at `a=` on your own outgoing mail: `rsa-sha256`, optionally plus `ed25519-sha256`, and never `rsa-sha1`. - Check the RSA key length behind the selector: at least 1024 bits by RFC 8301's MUST, 2048 by its SHOULD. - When adding Ed25519, check that the new selector's key record says `k=ed25519` and that the RSA signature is still present.

  • Can a domain sign only with ed25519-sha256?
    It can emit such a signature, but RFC 8301 still says signers MUST sign with `rsa-sha256`, and any receiver without Ed25519 support ignores the signature under RFC 6376 Section 3.3.4. RFC 8463 describes adding Ed25519 alongside RSA, under a separate selector, as the transition path.
  • Why do an rsa-sha256 and an ed25519-sha256 signature on one message often show the same bh= value?
    Both algorithms use SHA-256 for the body hash. If the two signatures also use the same body canonicalization and cover the same body length, they hash identical bytes and produce identical `bh=` values; only `a=`, `s=` and `b=` differ.

  • rsa-sha1 is fine because verifiers must still accept it.
  • ed25519-sha256 can replace RSA everywhere today without a second signature.
  • Both signatures can share one selector if they share d=.
  • Ed25519 signatures use a different body hash than rsa-sha256.
  • A 512-bit RSA key is acceptable if the algorithm is rsa-sha256.