An audit flags example.com's DKIM selector as a 1024-bit RSA key — what does RFC 8301 require, and how do you move to 2048 bits?
answer
- a floor and a recommendation
- January 2018 update
- verifiers handle up to 4096
- a bigger key, a new selector
basics
~20 sRFC 8301 (January 2018) sets 1024 bits as the floor: signers MUST use at least 1024 and SHOULD use at least 2048. Upgrade by rotation: publish a 2048-bit key under a new selector, switch signing, then revoke the old one.
solid answer
~50 sRFC 8301 section 3.2 says signers MUST use RSA keys of at least 1024 bits and SHOULD use at least 2048, and verifiers MUST be able to validate keys from 1024 to 4096 bits and MUST NOT accept signatures made with keys under 1024 bits. So a 1024-bit key is compliant with the MUST but below the SHOULD: the audit finding is a weakness to fix, not a failure today. The fix is an ordinary rollover: generate a 2048-bit pair, publish it at a new selector, check that a test message passes, switch signing, keep the 1024-bit record for the validation interval, then revoke it with an empty `p=`. The 2048-bit key is longer than one DNS TXT string can hold, so the record is published as several strings, and the test message is what proves the whole key arrived.
go deeper
Recall RFC 8301's numbers: at least 1024 bits required, at least 2048 recommended, and keys under 1024 never accepted.
Explain that the upgrade is a selector rollover, and that a 2048-bit key spans several TXT strings and must be proved with a test message.
Grade the finding correctly: 1024 bits is a SHOULD gap to schedule, while a key under 1024 bits means the domain's signatures already fail.
Set 2048-bit RSA as the domain-wide floor for every signer, including outside senders, and track it in the key inventory.
## What RFC 8301 changed DKIM's base specification, **RFC 6376** (September 2011), defined RSA signing and, as RFC 8301 puts it, recommended key sizes of 1024 to 2048 bits while still requiring verifiers to handle 512-bit keys. RFC 8301 (**January 2018**, Standards Track) updated it after the operational community recognised that short keys compromise DKIM's effectiveness, a concern RFC 8301 cites from a published vulnerability note. | Rule | RFC 6376 as published | After RFC 8301 | |---|---|---| | Signer's RSA key size | 1024 to 2048 bits recommended | MUST be at least 1024, SHOULD be at least 2048 | | Verifier must handle | down to 512 bits | 1024 to 4096 bits, MAY go larger | | Keys under 1024 bits | verifiable | MUST NOT be considered valid | | `rsa-sha1` | allowed | MUST NOT be used for signing or verifying | RFC 8301 also says a signature with an insufficient key size has **permanently failed** evaluation, and lets verifier policy use the length of the signing key as one metric for whether a signature is acceptable. ## Reading the audit finding - A **1024-bit key** meets the MUST and misses the SHOULD. Verifiers following RFC 8301 still accept it, so nothing is broken today. - A key **under 1024 bits** is a different finding: its signatures already fail at conforming verifiers, so that domain is effectively unsigned. - The SHOULD exists because 1024-bit RSA has the smaller security margin; *why* key length sets that margin is covered with asymmetric encryption, not here. ## Moving to 2048 bits A longer key is a new key, so the upgrade is a normal **selector rollover**: 1. Generate a 2048-bit RSA key pair on the signing system. 2. Publish it at a new selector, for example `s2026b._domainkey.example.com`, with `k=rsa`. 3. Confirm the full key is published: send a test message to a mailbox you control and look for `dkim=pass` with `header.s=s2026b`. 4. Switch signing to the new selector on every signing host. 5. Keep the 1024-bit record published for the validation interval, so queued and late-verified mail still verifies. 6. Revoke the 1024-bit selector with an empty `p=` and destroy its private key. ## Practical snags - **Record length**: RFC 8301 notes that widely used DNS configuration software handled only a single 256-octet string in a TXT record, and that RSA keys significantly longer than 1024 bits do not fit in one. A 2048-bit key is therefore published as several strings in one TXT record; the exact mechanics are covered with DKIM key records. - **A key that did not publish in full** shows up only as signatures that do not verify, which is why step 3 sends a real message rather than only reading the record back. - **Do not upgrade under the same selector**: replacing the key in place breaks mail already signed with the 1024-bit key, as in any rotation. - **Choosing above 2048**: up to 4096 bits is inside the range every conforming verifier MUST handle; beyond that, RFC 8301 only says verifiers MAY. A larger key also means a larger record and more signing work. ## Checking the whole estate - **Every signer counts**: list each selector the domain publishes, who signs with it and its key length, including outside sending services that sign as the domain. - **Look at the algorithm too**: a signature still using `rsa-sha1` is a harder finding than a 1024-bit key, because RFC 8301 says `rsa-sha1` MUST NOT be used for signing or verifying, so those signatures already fail. - **Confirm the old selector goes quiet**: DMARC aggregate reports name the selector on each DKIM row (required since RFC 9990, May 2026), so the 1024-bit selector's rows should fall to zero before it is revoked. ## Verifier side Receivers are not obliged to reject 1024-bit signatures, and RFC 8301 forbids them from accepting anything shorter. A verifier policy may weigh key length, so a domain that wants its signatures to count everywhere has a reason to meet the SHOULD rather than the MUST.
- Why not jump straight to a 4096-bit RSA DKIM key?RFC 8301 says verifiers MUST validate keys from 1024 to 4096 bits, so 4096 is permitted. It brings a longer record split over more strings, a larger DNS answer and more signing work, for a key that is rotated anyway; 2048 meets the RFC's SHOULD and is a common choice.
- Can you add a 2048-bit RSA key to the existing DKIM selector's record beside the 1024-bit one?Not reliably. RFC 8463 states that there can only be a single key record per selector, and RFC 6376 lets a verifier that finds several pick any one of them. A second key needs a second selector, so the move to 2048 bits is published as a new selector.
- RFC 8301 made 2048 bits mandatory, so 1024-bit signatures fail now.
- Verifiers still have to accept 512-bit DKIM keys.
- Just overwrite the existing selector's key with the 2048-bit one.
- Bigger is better: use 8192 bits so every verifier ranks it highest.
- A 2048-bit key can be added under the existing selector beside the old one.