Skip to content
  • There are no suggestions because the search field is empty.

1024-bit vs 2048-bit DKIM keys

A 1024-bit DKIM key still meets the minimum in the DKIM standard and at Gmail and Yahoo, but 2048 bits is the recommended length. Signers must use RSA keys of at least 1024 bits and should use RSA keys of at least 2048 bits. Choosing 2048 bits is a security upgrade, not a promise of better delivery, and is best done at your next key rotation, as long as your DNS host can hold the longer record.

What the standard says

The current key-length rules, updated in 2018, are:

  • Signers must use RSA keys of at least 1024 bits, and should use at least 2048.
  • Verifiers must be able to validate keys from 1024 to 4096 bits.
  • Verifiers must not treat signatures with RSA keys under 1024 bits as valid.
  • Verifier policies "can use the length of the signing key as one metric" for deciding whether a signature is acceptable.
  • The algorithm must be rsa-sha256. rsa-sha1 must not be used for signing or verifying.

You may still see older text that talked about verifying keys from 512 bits. That guidance has been replaced. Use the current key-length rules above.

The reason for the recommendation is simple. Short RSA keys more easily succumb to off-line attacks. A 2019 industry assessment described 1024-bit RSA as at the edge of attack for general-purpose computer systems, and 2048-bit as considered immune to cracking in that computing environment. That's a 2019 assessment, but it points the same way as the current rules.

What mailbox providers and platforms say

Who What they say
Gmail (receiving) "Sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer. For security reasons, we recommend using a 2048-bit key if your domain provider supports this."
Yahoo (receiving) "Authenticate every email with DKIM... with a minimum 1024-bit key length"
Google Workspace (signing) Offers 2048 ("Longer keys are more secure than shorter keys") or 1024 "if your domain host doesn't support 2048-bit keys"
Microsoft 365 (signing) In PowerShell, New-DkimSigningConfig -KeySize lists "1024 (default)" and 2048. You can move to 2048 with Rotate-DkimSigningConfig -KeySize 2048
Amazon SES (signing) Easy DKIM defaults to 2048 bits, with 1024 selectable. "2048 bits is always preferred," but 1024 may be needed with "a DNS provider who only supports DKIM 1024"
MailerSend (signing) Since August 2026 it issues 2048-bit keys to new domains, "replacing the 1024-bit single keys," and recommends existing domains migrate

So what's actually changing? Some sending services now issue 2048-bit keys by default. We found no page from Google, Yahoo, or Microsoft saying they reject or are phasing out 1024-bit keys when they receive mail. Gmail and Yahoo state 1024 as their minimum. For the wider rules each provider sets, see Google, Yahoo, and Microsoft sender requirements.

The real obstacle with 2048: DNS

One obstacle to using 2048 is the DNS host's handling of long TXT values. A 2048-bit public key doesn't fit in one TXT string. A single string inside a TXT record can hold at most 255 characters, and some widely used DNS software only handles a single 256-octet string in a TXT record.

The fix is to split the key into several quoted strings inside one TXT record (DKIM selectors and DNS records shows the format). If the host silently cuts the value, or stores the strings out of order, every message signed with that key fails DKIM. Google's alternatives are a 1024-bit key or asking your host about longer TXT records.

Keys delegated by CNAME avoid the problem, because the provider hosts the long record. That's how Microsoft 365 and many sending platforms work.

DNS servers also need EDNS0 or TCP support for long records.

Should you go bigger than 2048?

Not as a general rule. Verifiers only have to support keys up to 4096 bits, and very large keys might not fit within a 512-byte DNS UDP response. Bigger isn't automatically safer if receivers can't fetch or verify it.

What about Ed25519?

ed25519-sha256 uses much shorter keys. Signers should implement it and verifiers must implement it. Because some receivers might not verify it yet, the usual advice is to sign with both an RSA key and an Ed25519 key, under different selectors. None of Google, Microsoft, Yahoo, or Amazon SES offered Ed25519 signing when we last checked. Treat it as an optional extra signature, never as a replacement for RSA.

How to upgrade from 1024 to 2048

An upgrade is a key rotation. Don't paste the new key over the record at your live selector: mail that's in transit, or checked later, would then fail against the wrong key.

  1. Generate a 2048-bit key and publish it under a new selector.
  2. Wait for the record to resolve.
  3. Switch signing to the new key.
  4. Confirm new mail shows dkim=pass with the new s=.
  5. Keep the old key published for an overlap period, then remove or revoke it.

The full procedure, including how long to overlap, is in How to rotate a DKIM key. On Microsoft 365, the two-selector rotation does this for you, and a rotation takes 96 hours. In Google Workspace, you generate a new 2048-bit record and use a different prefix if one is already in use. Platform screens are in DMARC for Microsoft 365 and DMARC for Google Workspace.

How to check your DKIM key length

The length is encoded in the p= value of the DKIM record, so you can't read it at a glance. Practical routes:

  • Your provider's console. In Microsoft 365, Get-DkimSigningConfig shows Selector1KeySize and Selector2KeySize.
  • Decode the public key from the p= value with standard command-line crypto tools, and read its size.

Find the selector first by reading s= in a real message (DKIM selectors and DNS records).

Mistakes worth avoiding

  • A truncated 2048-bit key at the DNS host, so every message fails DKIM (Why DKIM signatures fail).
  • Overwriting the live 1024-bit selector with the 2048-bit key, so mail in flight fails.
  • Assuming Microsoft 365 already uses 2048. The PowerShell default is 1024. Check the key size.
  • Treating a scanner's "1024-bit" warning as a delivery emergency. It's a security recommendation. Gmail and Yahoo still accept 1024.

Free DMARC account

Turn raw DMARC reports into a readable dashboard

Point your rua address to our platform and read the results by sender and source instead of opening XML files.

  • Results grouped by sending source
  • SPF, DKIM and alignment results per sender
  • The original XML reports are still there to download

Create a free DMARC accountTalk to an expert

FAQ

Is a 1024-bit DKIM key still OK?

It meets the minimum in the current standard, at Gmail, and at Yahoo. 2048 is recommended, so upgrade at your next rotation if your DNS host supports it.

Will a 2048-bit key improve deliverability?

The sources recommend it for security, not as a promise of inbox placement. A valid DKIM signature still needs alignment to count for DMARC (What is DKIM and how it works).

Why won't my DNS host accept the 2048-bit key?

It's longer than one 255-character string. Split it into quoted strings in one record, use the provider's CNAME option, or ask the host.

Should I use a 4096-bit key?

Not generally. Receivers only have to support up to 4096, and very long keys can run into DNS size limits.