| Internet-Draft | AEAD Limits | March 2022 |
| Günther, et al. | Expires 8 September 2022 | [Page] |
An Authenticated Encryption with Associated Data (AEAD) algorithm providesconfidentiality and integrity. Excessive use of the same key can give anattacker advantages in breaking these properties. This document provides simpleguidance for users of common AEAD functions about how to limit the use of keysin order to bound the advantage given to an attacker. It considers limits inboth single- and multi-key settings.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Crypto Forum Research Group mailing list (cfrg@ietf.org), which is archived athttps://mailarchive.ietf.org/arch/search/?email_list=cfrg.¶
Source for this draft and an issue tracker can be found athttps://github.com/cfrg/draft-irtf-cfrg-aead-limits.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is athttps://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 8 September 2022.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
An Authenticated Encryption with Associated Data (AEAD) algorithmprovides confidentiality and integrity.[RFC5116] specifies an AEADas a function with four inputs -- secret key, nonce, plaintext, associated data(of which plaintext and associated data can optionally be zero-length) -- thatproduces ciphertext output and an error codeindicating success or failure. The ciphertext is typically composed of the encryptedplaintext bytes and an authentication tag.¶
The generic AEAD interface does not describe usage limits. Each AEAD algorithmdoes describe limits on its inputs, but these are formulated as strictfunctional limits, such as the maximum length of inputs, which are determined bythe properties of the underlying AEAD composition. Degradation of the securityof the AEAD as a single key is used multiple times is not given the samethorough treatment.¶
Effective limits can be influenced by the number of "users" ofa given key. In the traditional setting, there is one key shared between twoparties. Any limits on the maximum length of inputs or encryption operationsapply to that single key. The attacker's goal is to break security(confidentiality or integrity) of that specific key. However, in practice, thereare often many users with independent keys. This multi-key security setting,often referred to as the multi-user setting in the academic literature,considers an attacker's advantage in breaking security of any of these manykeys, further assuming the attacker may have done some offline work to help breaksecurity. As a result, AEAD algorithm limits may depend on offline work and thenumber of keys. However, given that a multi-key attacker does not target any specifickey, acceptable advantages may differ from that of the single-key setting.¶
The number of times a single pair of key and nonce can be used might also berelevant to security. For some algorithms, such as AEAD_AES_128_GCM orAEAD_AES_256_GCM, this limit is 1 and using the same pair of key and nonce hasserious consequences for both confidentiality and integrity; see[NonceDisrespecting]. Nonce-reuse resistant algorithms likeAEAD_AES_128_GCM_SIV can tolerate a limited amount of nonce reuse.¶
It is good practice to have limits on how many times the same key (or pair ofkey and nonce) are used. Setting a limit based on some measurable property ofthe usage, such as number of protected messages or amount of data transferred,ensures that it is easy to apply limits. This might require the application ofsimplifying assumptions. For example, TLS 1.3 and QUIC both specify limits onthe number of records that can be protected, using the simplifying assumptionthat records are the same size; seeSection 5.5 of [TLS] andSection 6.6 of [RFC9001].¶
Exceeding the determined usage limit can be avoided using rekeying. Rekeyinguses a lightweight transform to produce new keys. Rekeying effectively resetsprogress toward single-key limits, allowing a session to be extended withoutdegrading security. Rekeying can also provide a measure of forward andbackward (post-compromise) security.[RFC8645] contains a thorough surveyof rekeying and the consequences of different design choices.¶
Currently, AEAD limits and usage requirements are scattered among peer-reviewedpapers, standards documents, and other RFCs. Determining the correct limits fora given setting is challenging as papers do not use consistent labels orconventions, and rarely apply any simplifications that might aid in reaching asimple limit.¶
The intent of this document is to collate all relevant information about theproper usage and limits of AEAD algorithms in one place. This may serve as astandard reference when considering which AEAD algorithm to use, and how to useit.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALLNOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED","MAY", and "OPTIONAL" in this document are to be interpreted asdescribed in BCP 14[RFC2119][RFC8174] when, and only when, theyappear in all capitals, as shown here.¶
This document defines limitations in part using the quantities inTable 1 below.¶
| Symbol | Description |
|---|---|
| n | AEAD block length (in bits) |
| k | AEAD key length (in bits) |
| r | AEAD nonce length (in bits) |
| t | Size of the authentication tag (in bits) |
| l | Maximum length of each message (in blocks) |
| s | Total plaintext length in all messages (in blocks) |
| q | Number of protected messages (AEAD encryption invocations) |
| v | Number of attacker forgery attempts (failed AEAD decryption invocations) |
| p | Upper bound on adversary attack probability |
| o | Offline adversary work (in number of encryption and decryption queries; multi-key setting only) |
| u | Number of keys (multi-key setting only) |
| B | Maximum number of blocks encrypted by any key (multi-key setting only) |
For each AEAD algorithm, we define the (passive) confidentiality and (active)integrity advantage roughly as the advantage an attacker has in breaking thecorresponding classical security property for the algorithm. A passive attackercan query ciphertexts for arbitrary plaintexts. An active attacker can additionallyquery plaintexts for arbitrary ciphertexts. Moreover, we define the combinedauthenticated encryption advantage guaranteeing both confidentiality and integrityagainst an active attacker. Specifically:¶
See[AEComposition],[AEAD] for the formal definitions of and relationsbetween passive confidentiality (IND-CPA), ciphertext integrity (INT-CTXT),and authenticated encryption security (AE).The authenticated encryption advantage subsumes, and can be derived as thecombination of, both CA and IA:¶
CA <= AEAIA <= AEAAEA <= CA + IA¶
Each application requires an individual determination of limits in order to keep CAand IA sufficiently small. For instance, TLS aims to keep CA below 2-60 and IAbelow 2-57 in the single-key setting; seeSection 5.5 of [TLS].¶
Once upper bounds on CA, IA, or AEA are determined, this documentdefines a process for determining three overall operational limits:¶
When limits are expressed as a number of messages an application can encrypt ordecrypt, this requires assumptions about the size of messages and anyauthenticated additional data (AAD). Limits can instead be expressed in termsof the number of bytes, or blocks, of plaintext and maybe AAD in total.¶
To aid in translating between message-based and byte/block-based limits,a formulation of limits that includes a maximum message size (l) and the AEADschemes' block length in bits (n) is provided.¶
All limits are based on the total number of messages, either the number ofprotected messages (q) or the number of forgery attempts (v); which correspondto CL and IL respectively.¶
Limits are then derived from those bounds using a target attacker probability.For example, given an integrity advantage ofIA = v * (8l / 2^106) and atargeted maximum attacker success probability ofIA = p, the algorithm remainssecure, i.e., the adversary's advantage does not exceed the targeted probabilityof success, provided thatv <= (p * 2^106) / 8l. In turn, this implies thatv <= (p * 2^103) / l is the corresponding limit.¶
To apply these limits, implementations can count the number of messages that areprotected or rejected against the determined limits (q and v respectively).This requires that messages cannot exceed the maximum message size (l) that ischosen.¶
This analysis assumes a message-based approach to setting limits.Implementations that use byte counting rather than message counting could use amaximum message size (l) of one to determine a limit for q that can be appliedwith byte counting. This results in attributing per-message overheads to everybyte, so the resulting limit could be significantly lower than necessary.Actions, like rekeying, that are taken to avoid the limit might occur moreoften as a result.¶
This section summarizes the confidentiality and integrity bounds and limits for modern AEAD algorithmsused in IETF protocols, including: AEAD_AES_128_GCM[RFC5116], AEAD_AES_256_GCM[RFC5116],AEAD_AES_128_CCM[RFC5116], AEAD_CHACHA20_POLY1305[RFC8439], AEAD_AES_128_CCM_8[RFC6655].The limits in this section apply to using these schemes with a single key;for settings where multiple keys are deployed (for example, when rekeying withina connection), seeSection 6.¶
These algorithms, as cited, all define a nonce length (r) of 96 bits. Somedefinitions of these AEAD algorithms allow for other nonce lengths, but theanalyses in this document all fix the nonce length to r = 96. Using other noncelengths might result in different bounds; for example,[GCMProofs] shows thatusing a variable-length nonce for AES-GCM results in worse security bounds.¶
The CL and IL values bound the total number of encryption and forgery queries (q and v).Alongside each advantage value, we also specify these bounds.¶
The CL and IL values for AES-GCM are derived in[AEBounds] and summarized below.For this AEAD, n = 128 and t = 128[GCM]. In this example, the length s is the sumof AAD and plaintext (in blocks of 128 bits), as described in[GCMProofs].¶
CA <= ((s + q + 1)^2) / 2^129¶
This implies the following usage limit:¶
q + s <= p^(1/2) * 2^(129/2) - 1¶
Which, for a message-based protocol withs <= q * l, if we assume that everypacket is sizel (in blocks of 128 bits), produces the limit:¶
q <= (p^(1/2) * 2^(129/2) - 1) / (l + 1)¶
IA <= 2 * (v * (l + 1)) / 2^128¶
This implies the following limit:¶
v <= (p * 2^127) / (l + 1)¶
The known single-user analyses for AEAD_CHACHA20_POLY1305[ChaCha20Poly1305-SU],[ChaCha20Poly1305-MU] combine the confidentiality and integrity limits into asingle expression, covered below. For this AEAD, n = 512, k = 256, and t = 128;the length l is the sum of AAD and plaintext (in blocks of 128 bits),see[ChaCha20Poly1305-MU].¶
AEA <= (v * (l + 1)) / 2^103¶
This advantage is a tight reduction based on the underlying Poly1305 PRF[Poly1305].It implies the following limit:¶
v <= (p * 2^103) / (l + 1)¶
The CL and IL values for AEAD_AES_128_CCM are derived from[CCM-ANALYSIS]and specified in the QUIC-TLS mapping specification[RFC9001]. This analysis uses the totalnumber of underlying block cipher operations to derive its bound. For CCM, this number is the sum of:the length of the associated data in blocks, the length of the ciphertext in blocks, the length ofthe plaintext in blocks, plus 1.¶
In the following limits, this is simplified to a value of twice the length of the packet in blocks,i.e., 2l represents the effective length, in number of block cipher operations, of a message withl blocks. This simplification is based on the observation that common applications of this AEAD carryonly a small amount of associated data compared to ciphertext. For example, QUIC has 1 to 3 blocks of AAD.¶
For this AEAD, n = 128 and t = 128.¶
CA <= (2l * q)^2 / 2^n <= (2l * q)^2 / 2^128¶
This implies the following limit:¶
q <= sqrt((p * 2^126) / l^2)¶
IA <= v / 2^t + (2l * (v + q))^2 / 2^n <= v / 2^128 + (2l * (v + q))^2 / 2^128¶
This implies the following limit:¶
v + (2l * (v + q))^2 <= p * 2^128¶
In a setting wherev orq is sufficiently large,v is negligible compared to(2l * (v + q))^2, so this this can be simplified to:¶
v + q <= sqrt(p) * 2^63 / l¶
The analysis in[CCM-ANALYSIS] also applies to this AEAD, but the reduced taglength of 64 bits changes the integrity limit calculation considerably.¶
IA <= v / 2^t + (2l * (v + q))^2 / 2^n <= v / 2^64 + (2l * (v + q))^2 / 2^128¶
This results in reducing the limit onv by a factor of 2^64.¶
v * 2^64 + (2l * (v + q))^2 <= p * 2^128¶
An example protocol might choose to aim for a single-key CA and IA that is atmost 2-50. If the messages exchanged in the protocol are at most acommon Internet MTU of around 1500 bytes, then a value for l might be set to27.Table 2 shows limits for q and v that might bechosen under these conditions.¶
| AEAD | Maximum q | Maximum v |
|---|---|---|
| AEAD_AES_128_GCM | 232.5 | 271 |
| AEAD_AES_256_GCM | 232.5 | 271 |
| AEAD_CHACHA20_POLY1305 | n/a | 246 |
| AEAD_AES_128_CCM | 230 | 230 |
| AEAD_AES_128_CCM_8 | 230.9 | 213 |
AEAD_CHACHA20_POLY1305 provides no limit to q based on the provided single-useranalyses.¶
The limit for q on AEAD_AES_128_CCM and AEAD_AES_128_CCM_8 is reduced due to aneed to reduce the value of q to ensure that IA does not exceed the target.This assumes equal proportions for q and v for AEAD_AES_128_CCM.AEAD_AES_128_CCM_8 permits a much smaller value of v due to the shorter tag,which permits a higher limit for q.¶
Some protocols naturally limit v to 1, such as TCP-based variants of TLS, whichterminate sessions on decryption failure. If v is limited to 1, q can beincreased to 231 for both CCM AEADs.¶
In the multi-key setting, each user is assumed to have an independent anduniformly distributed key, though nonces may be re-used across users with somevery small probability. The success probability in attacking one of these manyindependent keys can be generically bounded by the success probability ofattacking a single key multiplied by the number of keys present[MUSecurity],[GCM-MU].Absent concrete multi-key bounds, this means the attacker advantage in the multi-keysetting is the product of the single-key advantage and the number of keys.¶
This section summarizes the confidentiality and integrity bounds and limits forthe same algorithms as inSection 5 for the multi-key setting. The CLand IL values bound the total number of encryption and forgery queries (q and v).Alongside each value, we also specify these bounds.¶
Concrete multi-key bounds for AEAD_AES_128_GCM and AEAD_AES_256_GCM exist due toTheorem 4.3 in[GCM-MU2], which covers protocols with nonce randomization,like TLS 1.3[TLS] and QUIC[RFC9001]. Here, the full nonce is XORed witha secret, random offset. The bound for nonce randomization was further improvedin[ChaCha20Poly1305-MU].¶
Results for AES-GCM with random, partially implicit nonces[RFC5288] arecaptured by Theorem 5.3 in[GCM-MU2], which apply to protocols such asTLS 1.2[RFC5246]. Here, the implicit part of the nonce is a random value,of length at least 32 bits and fixed per key, while the explicit part of thenonce is a non-repeating counter. The full nonce is the concatenation of thetwo parts. This produces similar limits under most conditions.¶
For this AEAD, n = 128, t = 128, and r = 96; the key length is k = 128 or k =256 for AEAD_AES_128_GCM and AEAD_AES_128_GCM respectively.¶
Protocols with nonce randomization have a limit of:¶
AEA <= (q+v)*l*B / 2^127¶
This implies the following limit:¶
q + v <= p * 2^127 / (l * B)¶
This assumes that B is much larger than 100; that is, each user encipherssignificantly more than 1600 bytes of data. Otherwise, B should be increased by 161 forAEAD_AES_128_GCM and by 97 for AEAD_AES_256_GCM.¶
Protocols with random, partially implicit nonces have the following limit,which is similar to that for nonce randomization:¶
AEA <= (((q+v)*o + (q+v)^2) / 2^(k+26)) + ((q+v)*l*B / 2^127)¶
The first term is negligible if k = 256; this implies the following simplifiedlimits:¶
AEA <= (q+v)*l*B / 2^127q + v <= p * 2^127 / (l * B)¶
For k = 128, assuming o <= q+v (i.e., that the attacker does not spend more work than all legitimate protocol users together), the limits are:¶
AEA <= (((q+v)*o + (q+v)^2) / 2^154) + ((q+v)*l*B / 2^127)q + v <= min( sqrt(p) * 2^76, p * 2^126 / (l * B) )¶
The confidentiality advantage is essentially dominated by the same term asthe AE advantage for protocols with nonce randomization:¶
CA <= q*l*B / 2^127¶
This implies the following limit:¶
q <= p * 2^127 / (l * B)¶
Similarly, the limits for protocols with random, partially implicit nonces are:¶
CA <= ((q*o + q^2) / 2^(k+26)) + (q*l*B / 2^127)q <= min( sqrt(p) * 2^76, p * 2^126 / (l * B) )¶
There is currently no dedicated integrity multi-key bound available forAEAD_AES_128_GCM and AEAD_AES_256_GCM. The AE limit can be used to derivean integrity limit as:¶
IA <= AEA¶
Section 6.1.1 therefore contains the integrity limits.¶
Concrete multi-key bounds for AEAD_CHACHA20_POLY1305 are given in Theorem 7.8in[ChaCha20Poly1305-MU], covering protocols with nonce randomization likeTLS 1.3[TLS] and QUIC[RFC9001].¶
For this AEAD, n = 512, k = 256, t = 128, and r = 96; the length l is the sumof AAD and plaintext (in blocks of 128 bits).¶
Protocols with nonce randomization have a limit of:¶
AEA <= (v * (l + 1)) / 2^103¶
It implies the following limit:¶
v <= (p * 2^103) / (l + 1)¶
Note that this is the same limit as in the single-user case except that thetotal number of forgery attemptsv and maximum message length in blockslis calculated across all used keys.¶
While the AE advantage is dominated by the number of forgery attemptsv,those are irrelevant for the confidentiality advantage. The relevantlimit for protocols with nonce randomization becomes dominated, at a very lowlevel, by the adversary's offline worko, number of protected messagesqand maximum blocks encryptedB, across all used keys:¶
CA <= ((o + q) / 2^247) + ((B + q)^2 / 2^513)¶
It implies the following simplified limit, which for most reasonable valuesofp is dominated by a technical limitation aroundq = 2^100:¶
q <= min( p * 2^246 - o, sqrt(p) * 2^256 - B, 2^100 )¶
The AE limit for AEAD_CHACHA20_POLY1305 essentially is the integrity (multi-key)bound. The former hence also applies to the latter:¶
IA <= AEA¶
Section 6.2.1 therefore contains the integrity limits.¶
There are currently no concrete multi-key bounds for AEAD_AES_128_CCM orAEAD_AES_128_CCM_8. Thus, to account for the additionalfactoru, i.e., the number of keys, eachp term in the confidentiality andintegrity limits is replaced withp / u.¶
The multi-key integrity limit for AEAD_AES_128_CCM is as follows.¶
v + q <= sqrt(p / u) * 2^63 / l¶
Likewise, the multi-key integrity limit for AEAD_AES_128_CCM_8 is as follows.¶
v * 2^64 + (2l * (v + q))^2 <= (p / u) * 2^128¶
An example protocol might choose to aim for a multi-key AEA, CA, and IA that is atmost 2-50. If the messages exchanged in the protocol are at most acommon Internet MTU of around 1500 bytes, then a value for l might be set to27.Table 3 shows limits for q and v across all keys thatmight be chosen under these conditions.¶
| AEAD | Maximum q | Maximum v |
|---|---|---|
| AEAD_AES_128_GCM | 269/B | 269/B |
| AEAD_AES_256_GCM | 269/B | 269/B |
| AEAD_CHACHA20_POLY1305 | 2100 | 246 |
| AEAD_AES_128_CCM | 230/sqrt(u) | 230/sqrt(u) |
| AEAD_AES_128_CCM_8 | 230.9/sqrt(u) | 213/u |
The limits for AEAD_AES_128_GCM, AEAD_AES_256_GCM, AEAD_AES_128_CCM, andAEAD_AES_128_CCM_8 assume equal proportions for q and v. The limits forAEAD_AES_128_GCM, AEAD_AES_256_GCM and AEAD_CHACHA20_POLY1305 assume the useof nonce randomization, like in TLS 1.3[TLS] and QUIC[RFC9001].¶
The limits for AEAD_AES_128_GCM and AEAD_AES_256_GCM further depend on themaximum number B of 128-bit blocks encrypted by any single key. For example,limiting the number of messages (of size <= 2^7 blocks) to at most 2^20 (about amillion) per key results in B = 2^27, which limits both q and v to 2^42 messages.¶
Only the limits for AEAD_AES_128_CCM and AEAD_AES_128_CCM_8 depend on the numberof used keys u, which further reduces them considerably. If v is limited to 1,q can be increased to 231/sqrt(u) for both CCM AEADs.¶
The different analyses of AEAD functions that this work is based upon generallyassume that the underlying primitives are ideal. For example, that apseudorandom function (PRF) used by the AEAD is indistinguishable from a trulyrandom function or that a pseudorandom permutation (PRP) is indistinguishablefrom a truly random permutation. Thus, the advantage estimates assume that theattacker is not able to exploit a weakness in an underlying primitive.¶
Many of the formulae in this document depend on simplifying assumptions,from differing models, which means that results are not universally applicable. When using thisdocument to set limits, it is necessary to validate all these assumptionsfor the setting in which the limits might apply. In most cases, the goal isto use assumptions that result in setting a more conservative limit, but thisis not always the case. As an example of one such simplification, this documentdefines v as the total number of failed decryption queries (that is, failed forgeryattempts), whereas models usually count in v all forgery attempts.¶
The CA, IA, and AEA values defined in this document are upper bounds based on existingcryptographic research. Future analysis may introduce tighter bounds. ApplicationsSHOULD NOT assume these bounds are rigid, and SHOULD accommodate changes. Inparticular, in two-party communication, one participant cannot regard apparentoveruse of a key by other participants as being in error, when it could be thatthe other participant has better information about bounds.¶
Note that the limits in this document apply to the adversary's ability toconduct a single successful forgery. For some algorithms and in some cases,an adversary's success probability in repeating forgeries may be noticeablylarger than that of the first forgery. As an example,[MF05] describessuch multiple forgery attacks in the context of AES-GCM in more detail.¶
This document does not make any request of IANA.¶
draft-irtf-cfrg-aead-limits-04
| Document | Document type | This is an older version of an Internet-Draft whose latest revision state is "Active". This document is an Internet-Draft (I-D) that has been submitted to the Internet Research Task Force (IRTF) stream. This I-D isnot endorsed by the IETF and hasno formal standing in theIETF standards process. | |
|---|---|---|---|
| Select version | |||
| Compare versions | |||
| Authors | Felix Günther,Martin Thomson,Christopher A. Wood | ||
| Replaces | draft-wood-cfrg-aead-limits | ||
| RFC stream | |||
| Other formats | |||
| Additional resources | Mailing list discussion |