rfc-8750

Implicit Initialization Vector (IV) for Counter-Based Ciphers in Encapsulating Security Payload (ESP)

D. Migault, T. Guggemos, Y. Nir
date2020-03 streamIETF areasec wgipsecme statusPROPOSED STANDARD pages8 canonicalhttps://www.rfc-editor.org/rfc/rfc8750 doi10.17487/RFC8750
Encapsulating Security Payload (ESP) sends an initialization vector (IV) in each packet. The size of the IV depends on the applied transform and is usually 8 or 16 octets for the transforms defined at the time this document was written. When used with IPsec, some algorithms, such as AES-GCM, AES-CCM, and ChaCha20-Poly1305, take the IV to generate a nonce that is used as an input parameter for encrypting and decrypting. This IV must be unique but can be predictable. As a result, the value provided in the ESP Sequence Number (SN) can be used instead to generate the nonce. This avoids sending the IV itself and saves 8 octets per packet in the case of AES-GCM, AES-CCM, and ChaCha20-Poly1305. This document describes how to do this.

Extracted elements (15)

design-rationale §1

AES-CBC is explicitly excluded because it requires an unpredictable IV; deriving the IV from the packet counter is insecure for CBC and has led to real-world chosen-plaintext attacks such as BEAST.

ipsec, crypto, security

design-rationale §1

Implicit IV is motivated by IoT use cases where saving the 8-byte IV per packet is significant. Since counter-based AEAD algorithms (AES-GCM, AES-CCM, ChaCha20-Poly1305) require the IV to be unique but not unpredictable, the ESP Sequence Number can directly serve as the IV source.

ipsec, crypto

design-rationale §7

The IIV transforms are defined for ESP only and cannot be used in IKEv2 because IKEv2 messages lack a unique per-message value suitable for IV generation; the IKEv2 Message-ID can repeat due to extensions RFC 6311 and RFC 7383.

ipsec, crypto

interoperability-note §6

Because the SA payload processing rules require the IKEv2 responder to select algorithms only from the initiator's proposal, a responder will never send an IIV transform to an initiator that did not propose it, ensuring safe negotiation with non-supporting peers.

ipsec, vpn

normative-requirement §5 SHOULD

An IKEv2 initiator supporting implicit IV SHOULD propose IIV algorithms in the Transform Type 1 Encryption Algorithm Substructure of the SA payload.

ipsec, vpn

normative-requirement §7 MUST NOT

Implicit IV MUST NOT be used in setups where there is a chance that the Sequence Number overlaps for one SA, since IV reuse under a given key breaks security of counter-mode ciphers.

ipsec, crypto, security

normative-requirement §7 MUST NOT

Implicit IV MUST NOT be used with Multicast unless mechanisms are employed that prevent Sequence Number overlap for one SA, since many senders share a single SA in multicast scenarios.

ipsec, multicast, security

normative-requirement §4 MUST NOT

The 8-byte IV MUST NOT repeat for a given key when using AES-GCM, AES-CCM, or ChaCha20-Poly1305 with implicit IV.

ipsec, crypto, vpn

normative-requirement §7 MUST

The sender's and receiver's counters MUST be reset (by establishing a new SA and thus a new key) prior to transmission of the 2^32nd packet for an SA without Extended Sequence Numbers, and prior to the 2^64th packet for an SA using Extended Sequence Numbers.

ipsec, crypto, security

normative-requirement §5 SHOULD

To facilitate backward compatibility, the initiator SHOULD also include the same algorithms with explicit IV as separate transforms in the IKEv2 SA payload.

ipsec, vpn

protocol-element §8

Three new ESP-only encryption transforms are defined: ENCR_AES_CCM_8_IIV (29), ENCR_AES_GCM_16_IIV (30), and ENCR_CHACHA20_POLY1305_IIV (31). These transforms use implicit IV and are not allowed for IKEv2.

ipsec, crypto, registry

registry §8

Three new code points (29: ENCR_AES_CCM_8_IIV, 30: ENCR_AES_GCM_16_IIV, 31: ENCR_CHACHA20_POLY1305_IIV) have been added to the IKEv2 'Transform Type 1 - Encryption Algorithm Transform IDs' subregistry, each marked as ESP-only and not allowed for IKEv2.

ipsec, registry, crypto

security-consideration §7

The implicit IV mechanism provides an explicit and normative nonce generation method meeting the security requirements of AES-GCM, AES-CCM, and ChaCha20-Poly1305, closing an ambiguity left in prior specifications where nonce generation was implementation-defined.

ipsec, crypto, security

wire-format §4

When using a 4-byte Sequence Number, the implicit IV is constructed as a 4-byte zero field followed by the 4-byte ESP Sequence Number, forming an 8-byte IV total.

ipsec, crypto

wire-format §4

When using an 8-byte Extended Sequence Number, the implicit IV is the full 8-byte Extended Sequence Number of the Security Association; only the four low-order bytes are carried in the ESP packet.

ipsec, crypto