Diagnostic

DKIM RSA key under 1024 bits

Error · key.rsa.too_small

The key is only a <bits>-bit RSA key. RFC 8301 forbids verifiers from accepting keys under 1024 bits, so signatures will fail.

What it means

dkim.fyi imports the key from p= and reads the size of its RSA modulus. Under 1024 bits it rates the key weak, reports this error, and gives the record the verdict “Invalid”. Discover tags such a hit “weak”.

RFC 8301 updated DKIM’s key rules: signers must use RSA keys of at least 1024 bits, and verifiers must not consider signatures made with smaller keys valid. RFC 6376 had asked verifiers to handle keys from 512 bits; RFC 8301 replaced that.

When a message signed with this key is analysed on the Headers page or by the email check, its signature gets the result permerror. The finding quotes the record’s first error, which is this one unless the record has others.

How to fix it

  1. Generate a new 2048-bit RSA key.
  2. Publish it under a new selector: a TXT record at <new-selector>._domainkey.<domain> holding the public key in p=, usually after v=DKIM1;. If your DNS host cannot store a value that long in one string, split it into several 255-character strings within one TXT record.
  3. Validate the new selector before you use it. A 2048-bit key is rated strong.
  4. Switch the signer to the new selector and private key, then check a signed message.
  5. Retire the old selector by publishing it with an empty p=.

Check again

Sources

  1. RFC 8301: Cryptographic Algorithm and Key Usage Update to DomainKeys Identified Mail (DKIM)
  2. RFC 6376: DomainKeys Identified Mail (DKIM) Signatures