New cryptographic signature methods for DKIMTaughannock NetworksPO Box 727TrumansburgNY14886+1 831 480 2300standards@taugh.comDKIM was designed to allow new cryptographic algorithms to be added. This
document adds a new signing algorithm and a new way to represent signature validation keys.Discussion about this draft is directed to the
dcrup@ietf.org mailing
list.DKIM signs e-mail messages, by creating hashes of the message
headers and body and signing the header hash with a digital signature.
Message recipients fetch the signature verification key from the DNS where it is
stored in a TXT record.
The defining documents specify a single signing algorithm, RSA,
and recommend key sizes of 1024 to 2048 bits.
While 1024 bit signatures are common, stronger signatures are not.
Widely used DNS configuration software places a practical limit on key sizes, because
the software only handles a single 256 octet string in a TXT record, and RSA keys longer
than 1156 bits don't fit in 256 octets.
This document adds a new stronger signing algorithm, Edwards-Curve Digital Signature Algorithm using
the Curve25519 curve (ed25519),
which has much shorter keys than RSA for similar levels of security.
It also adds a new key representation for RSA keys, with the key itself in the signature and
a fixed length public key fingerprint that fits in a 256 octet string in the DNS.
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
.
Syntax descriptions use Augmented BNF (ABNF).
The ABNF tokens sig-a-tag-k, key-k-tag-type, and base64string are imported from .
Rather than using a public key stored in the DNS, an RSA signature can include the
corresponding public key, with a verification fingerprint in the DNS.
For an RSA signature with a key fingerprint, the Signing Algorithm is rsafp-sha256.
The DNS record contains a SHA-256 hash of the public key, stored in base64
in the p= tag. The key type tag MUST be present and contains k=rsafp.
Section 5.5 of , on computing the message hash and signature,
is modified as follows:
When creating a signature with a signing algorithm that uses a key fingerprint, the signer includes
the public key in the signature as a base64 encoded string in the p= tag.
The key in the tag is the same one that would be published in a non-fingerprint key record.
Section 3.7 of , on computing the message hashes, is not modified. Since the
key in the p= tag is known in advance, it is included in the signature in the same manner as all of the other
signature fields other than b=.
Section 6.1.3 of , to compute the verification, is modified as follows:
In item 4, if the signing algorithm uses a key fingerprint, extract the verification key
from the p= tag. If there is no such tag, the signature does not validate.
Extract the key hash from the p= tag of the key record.
If there is no such tag or the tag is empty, the signature does not validate.
Compute the SHA-256 hash of the verification key, and compare it to the value
of the key hash. If they are not the same, the signature does not validate.
Otherwise proceed to verify the signature using the validation key and the algorithm
described in the "a=" tag.
The ed25519-sha256 signing algorithm computes a message hash as defined in section 3
of , and signs it with the Pure variant of Ed25519, as defined in
in RFC 8032 section 5.1.
The signing algorithm is PureEdDSA, since the input
to the signing algorithm has already been hashed.
The DNS record for the verification public key MUST have a "k=ed25519" tag to indicate
that the key is an Ed25519 rather than RSA key.
The signature MAY contain a base64 copy of the public key in the p= tag, to enable checks
for a duplicate signature key selection cryptographic attack described in the Security section below.
Note: since Ed25519 keys are 256 bits long, a SHA-256 hash of a key is the same size
as the key itself, so there would be no benefit to storing ed25519 key fingerprints in the
key record rather than the keys themselves.
The syntax of DKIM signatures and DKIM keys are updated as follows.
The syntax of DKIM algorithm tags in section 3.5 of
is updated by adding this rule to the
existing rule for sig-a-tag-k:
The following tag is added to the list of
tags on the DKIM-Signature header field in section 3.5 of .
The public key (base64; REQUIRED for rsafp signatures, OPTIONAL otherwise). White space is ignored in
this value and MUST be ignored when reassembling the original key.
The syntax of DKIM key tags in section 3.6.1 of
is updated by adding this rule to the
existing rule for key-k-tag-type:
Section 3.3 of describes DKIM's hash and signature algorithms.
It is updated as follows:
Signers SHOULD implement and verifiers MUST implement the rsafp-sha256 and ed25519-sha256 algorithms.
Signers that use rsa-sha256 or rsafp-sha256 signatures MUST use keys at least 1024 bits long and SHOULD
use keys 2048 bits long.
Verifiers MUST NOT accept rsa-sha256 or rsafp-sha256 signatures with keys less than 1024 bits long.
For backward compatibility, signers MAY add multiple signatures that use old and new signing
algorithms or key representations.
Since there can only be a single key record in the DNS for each selector, the signatures
will have to use different selectors, although they can use the same d= and i= identifiers.
Ed25519 and key fingerprints are widely used cryptographic techniques, so the security of DKIM
signatures using new signing algorithms should be at least as good as those using old
algorithms.
The rsafp signature scheme describes a method where the public key
is hashed. The primary motivation for this design is allowing for
a small representation of large public keys. Hashing has a
secondary effect: the public key is included in messages and is signed.
Including and signing the public key renders duplicate
signature key selection attacks infeasible. An attacker cannot claim
a message by constructing a key that would be valid for a signed message because
the public key is covered by the signature.
There is currently no known way that an attacker might use a duplicate signature
key selection attack to their advantage and so defending against the attack is
not mandated by this specification. In the event that a potential attack
becomes known, a signer could include the public key in messages using the `p=`
parameter. If the `p=` parameter is present, a verifier MUST ensure that the
parameter contains the public key that it uses to verify the message signature.
IANA is requested to update registries as follows.
The following value is added to the DKIM Signature Tag RegistryTYPEREFERENCESTATUSp(this document)activeThe following values are added to the DKIM Key Type RegistryTYPEREFERENCESTATUSrsafp[RFC3447]activeed25519[RFC8032]activeAnother look at security definitionsAdvances in Mathematics of Communications, Vol 7,
Num 1, pp. 1-38.
Editorial changes only.
Remove deprecation cruft and inconsistent key advice.
Fix p= and k= text.
Change eddsa to ed25519.
Add Martin's key regeneration issue.
Remove hashed ed25519 keys. Fix typos and clarify text.
Move syntax updates to separate section.
Take out SHA-1 stuff.
Clarify EdDSA algorithm is ed25519 with Pure version
of the signing. Make references to tags and fields consistent.