IPSECME D. Migault
Internet-Draft Ericsson
Intended status: Standards Track T. Guggemos
Expires: November 10, 2018 LMU Munich
Y. Nir
Dell EMC
May 9, 2018
Implicit IV for Counter-based Ciphers in Encapsulating Security Payload
(ESP)
draft-ietf-ipsecme-implicit-iv-03
Abstract
Encapsulating Security Payload (ESP) sends an initialization vector
(IV) or nonce in each packet. The size of IV depends on the applied
transform, being usually 8 or 16 octets for the transforms defined by
the time this document is written. Some algorithms such as AES-GCM,
AES-CCM, AES-CTR and ChaCha20-Poly1305 require a unique nonce but do
not require an unpredictable nonce. When using such algorithms the
packet counter value can be used to generate a nonce. This avoids
sending the nonce itself, and saves in the case of AES-GCM, AES-CCM,
AES-CTR and ChaCha20-Poly1305 8 octets per packet. This document
describes how to do this.
Status of This Memo
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 at https://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 November 10, 2018.
Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved.
Migault, et al. Expires November 10, 2018 [Page 1]
Internet-Draft Implicit IV in ESP May 2018
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 Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Requirements notation . . . . . . . . . . . . . . . . . . . . 2
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
4. Implicit IV . . . . . . . . . . . . . . . . . . . . . . . . . 3
5. Initiator Behavior . . . . . . . . . . . . . . . . . . . . . 4
6. Responder Behavior . . . . . . . . . . . . . . . . . . . . . 5
7. Security Consideration . . . . . . . . . . . . . . . . . . . 5
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
10.1. Normative References . . . . . . . . . . . . . . . . . . 6
10.2. Informational References . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
1. Requirements notation
The 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 [RFC2119].
2. Introduction
Counter-based AES modes of operation such as AES-CTR ([RFC3686]),
AES-CCM ([RFC4309]), and AES-GCM ([RFC4106]) require the
specification of an nonce for each ESP packet. The same applies for
ChaCha20-Poly1305 ([RFC7634]). Currently this nonce is sent in each
ESP packet ([RFC4303]). This practice is designated in this document
as "explicit nonce".
In some context, such as IoT, it may be preferable to avoid carrying
the extra bytes associated to the IV and instead generate it locally
on each peer. The local generation of the nonce is designated in
this document as "implicit IV".
The size of this nonce depends on the specific algorithm, but all of
the algorithms mentioned above take an 8-octet nonce.
Migault, et al. Expires November 10, 2018 [Page 2]
Internet-Draft Implicit IV in ESP May 2018
This document defines how to compute the nonce locally when it is
implicit. It also specifies how peers agree with the Internet Key
Exchange version 2 (IKEv2 - [RFC7296]) on using an implicit IV versus
an explicit IV.
This document limits its scope to the algorithms mentioned above.
Other algorithms with similar properties may later be defined to use
this extension.
This document does not consider AES-CBC ([RFC3602]) as AES-CBC
requires the IV to be unpredictable. Deriving it directly from the
packet counter as described below is insecure as mentioned in
Security Consideration of [RFC3602] and has led to real world chosen
plain-text attack such as BEAST [BEAST].
3. Terminology
o IoT: Internet of Things.
o IV: Initialization Vector.
o IIV: Implicit Initialization Vector.
o Nonce: a fixed-size octet string used only once. This is similar
to IV, except that in common usage there is no implication of non-
predictability.
4. Implicit IV
With the algorithms listed in Section 2, the 8 byte nonce MUST NOT
repeat. The binding between a ESP packet and its nonce is provided
using the Sequence Number or the Extended Sequence Number. Figure 1
and Figure 2 represent the IV with a regular 4-byte Sequence Number
and with an 8-byte Extended Sequence Number respectively.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Zero |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: Implicit IV with a 4 byte Sequence Number
o Sequence Number: the 4 byte Sequence Number carried in the ESP
packet.
Migault, et al. Expires November 10, 2018 [Page 3]
Internet-Draft Implicit IV in ESP May 2018
o Zero: a 4 byte array with all bits set to zero.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extended |
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Implicit IV with an 8 byte Extended Sequence Number
o Extended Sequence Number: the 8 byte Extended Sequence Number of
the Security Association. The 4 byte low order bytes are carried
in the ESP packet.
As the IV MUST NOT repeat for one SA when Counter-Mode ciphers are
used, Implicit IV as described in this document MUST NOT be used in
setups with the chance that the Sequence Number overlaps for one SA.
Multicast as described in [RFC5374], [RFC6407] and
[I-D.yeung-g-ikev2] is a prominent example, where many senders share
one secret and thus one SA. Section 3.5 of [RFC6407] provides a
mechanism that MAY be used to prevent IV collisions when the same key
is used by multiple users. The mechanism consists in partitioning
the IV space between users by assigning the most significant byte to
a user. When implicit IV transforms are used, such mechanism cannot
be applied as the IV is not sent, but instead it is derived from the
Sequence Number. A similar mechanism could be used by associating
the most significant byte of the Sequence Number to a sender, while
the 3 remaining bytes will be used to carry the counter value. Such
mechanism prevents the use of Extended Sequence Number and limits the
number of packet to be sent to 2** 24 = 16777216, that is 16 M. Note
that associating instead the least significant byte of the Sequence
Number to the sender, would enable the system to use Extended
Sequence Number and as such extend the limit of packet to be sent to
2 ** ( 24 + 32 ) = 72057594037927936, that is 72 P. Note also that
in both cases the Sequence Number are not interpreted as numeric
values which impacts the replay window processing defined in
[RFC4302] and [RFC4302].
Unless some mechanism are provided to avoid collision between
Sequence Number, ( and so IV ), Implicit IV MUST NOT be used. As
such, it is NOT RECOMMENDED to use Implicit IV with Multicast.
5. Initiator Behavior
An initiator supporting this feature SHOULD propose implicit IV
algorithms in the Transform Type 1 (Encryption Algorithm)
Substructure of the Proposal Substructure inside the SA Payload. To
Migault, et al. Expires November 10, 2018 [Page 4]
Internet-Draft Implicit IV in ESP May 2018
facilitate backward compatibility with non-supporting peers the
initiator SHOULD also include those same algorithms without Implicit
IV (IIV) as separate transforms.
6. Responder Behavior
The rules of SA Payload processing require that responder picks its
algorithms from the proposal sent by the initiator, thus this will
ensure that the responder will never send an SA payload containing
the IIV transform to an initiator that did not propose it.
7. Security Consideration
Nonce generation for these algorithms has not been explicitly
defined. It has been left to the implementation as long as certain
security requirements are met. Typically, for AES-GCM, AES-CCM, AES-
CTR and ChaCha20-Poly1305, the IV is not allowed being repeated for
one particular key. This document provides an explicit and normative
way to generate IVs. The mechanism described in this document meets
the IV security requirements of all relevant algorithms.
8. IANA Considerations
This section assigns new code points to the recommended AEAD suites
provided in [RFC8221], thus the new Transform Type 1 - Encryption
Algorithm Transform IDs [IANA] are as defined below:
- ENCR_AES_CCM_8_IIV: 29
- ENCR_AES_GCM_16_IIV: 30
- ENCR_CHACHA20_POLY1305_IIV: 31
These algorithms should be added with this document as ESP Reference
and "Not Allowed" for IKEv2 Reference.
9. Acknowledgements
We would like to thanks people Valery Smyslov for their valuable
comments, David Schinazi for its implementation, as well as the
ipseceme chairs Tero Kivinen and David Waltermire for moving this
work forward.
10. References
Migault, et al. Expires November 10, 2018 [Page 5]
Internet-Draft Implicit IV in ESP May 2018
10.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC3602] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher
Algorithm and Its Use with IPsec", RFC 3602,
DOI 10.17487/RFC3602, September 2003,
<https://www.rfc-editor.org/info/rfc3602>.
[RFC3686] Housley, R., "Using Advanced Encryption Standard (AES)
Counter Mode With IPsec Encapsulating Security Payload
(ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004,
<https://www.rfc-editor.org/info/rfc3686>.
[RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode
(GCM) in IPsec Encapsulating Security Payload (ESP)",
RFC 4106, DOI 10.17487/RFC4106, June 2005,
<https://www.rfc-editor.org/info/rfc4106>.
[RFC4302] Kent, S., "IP Authentication Header", RFC 4302,
DOI 10.17487/RFC4302, December 2005,
<https://www.rfc-editor.org/info/rfc4302>.
[RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)",
RFC 4303, DOI 10.17487/RFC4303, December 2005,
<https://www.rfc-editor.org/info/rfc4303>.
[RFC4309] Housley, R., "Using Advanced Encryption Standard (AES) CCM
Mode with IPsec Encapsulating Security Payload (ESP)",
RFC 4309, DOI 10.17487/RFC4309, December 2005,
<https://www.rfc-editor.org/info/rfc4309>.
[RFC5374] Weis, B., Gross, G., and D. Ignjatic, "Multicast
Extensions to the Security Architecture for the Internet
Protocol", RFC 5374, DOI 10.17487/RFC5374, November 2008,
<https://www.rfc-editor.org/info/rfc5374>.
[RFC6407] Weis, B., Rowles, S., and T. Hardjono, "The Group Domain
of Interpretation", RFC 6407, DOI 10.17487/RFC6407,
October 2011, <https://www.rfc-editor.org/info/rfc6407>.
[RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T.
Kivinen, "Internet Key Exchange Protocol Version 2
(IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October
2014, <https://www.rfc-editor.org/info/rfc7296>.
Migault, et al. Expires November 10, 2018 [Page 6]
Internet-Draft Implicit IV in ESP May 2018
[RFC7634] Nir, Y., "ChaCha20, Poly1305, and Their Use in the
Internet Key Exchange Protocol (IKE) and IPsec", RFC 7634,
DOI 10.17487/RFC7634, August 2015,
<https://www.rfc-editor.org/info/rfc7634>.
[RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T.
Kivinen, "Cryptographic Algorithm Implementation
Requirements and Usage Guidance for Encapsulating Security
Payload (ESP) and Authentication Header (AH)", RFC 8221,
DOI 10.17487/RFC8221, October 2017,
<https://www.rfc-editor.org/info/rfc8221>.
10.2. Informational References
[BEAST] Thai, T. and J. Juliano, "Here Come The xor Ninjas", ,
May 2011, <https://www.researchgate.net/
publication/266529975_Here_Come_The_Ninjas>.
[I-D.yeung-g-ikev2]
Weis, B., Nir, Y., and V. Smyslov, "Group Key Management
using IKEv2", draft-yeung-g-ikev2-13 (work in progress),
March 2018.
[IANA] "IANA IKEv2 Parameter - Type 1 - Encryption Algorithm
Transform IDs", <https://www.iana.org/assignments/ikev2-
parameters/ikev2-parameters.xhtml#ikev2-parameters-5>.
Authors' Addresses
Daniel Migault
Ericsson
8275 Trans Canada Route
Saint Laurent, QC H4S 0B6
Canada
Email: daniel.migault@ericsson.com
Tobias Guggemos
LMU Munich
Oettingenstr. 67
80538 Munich, Bavaria
Germany
Email: guggemos@mnm-team.org
URI: http://mnm-team.org/~guggemos
Migault, et al. Expires November 10, 2018 [Page 7]
Internet-Draft Implicit IV in ESP May 2018
Yoav Nir
Dell EMC
9 Andrei Sakharov St
Haifa 3190500
Israel
Email: ynir.ietf@gmail.com
Migault, et al. Expires November 10, 2018 [Page 8]