--- 1/draft-ietf-ipsecme-chacha20-poly1305-10.txt 2015-07-06 15:15:07.358498086 -0700 +++ 2/draft-ietf-ipsecme-chacha20-poly1305-11.txt 2015-07-06 15:15:07.386498786 -0700 @@ -1,18 +1,18 @@ Network Working Group Y. Nir Internet-Draft Check Point -Intended status: Standards Track June 14, 2015 -Expires: December 16, 2015 +Intended status: Standards Track July 7, 2015 +Expires: January 8, 2016 ChaCha20, Poly1305 and their use in IKE & IPsec - draft-ietf-ipsecme-chacha20-poly1305-10 + draft-ietf-ipsecme-chacha20-poly1305-11 Abstract This document describes the use of the ChaCha20 stream cipher along with the Poly1305 authenticator, combined into an AEAD algorithm for the Internet Key Exchange protocol (IKEv2) and for IPsec. Status of This Memo This Internet-Draft is submitted in full conformance with the @@ -21,21 +21,21 @@ 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 http://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 December 16, 2015. + This Internet-Draft will expire on January 8, 2016. Copyright Notice Copyright (c) 2015 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 (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents @@ -46,24 +46,24 @@ described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Conventions Used in This Document . . . . . . . . . . . . 3 2. ChaCha20 & Poly1305 for ESP . . . . . . . . . . . . . . . . . 3 2.1. AAD Construction . . . . . . . . . . . . . . . . . . . . 5 3. Use in IKEv2 . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Negotiation in IKEv2 . . . . . . . . . . . . . . . . . . . . 5 - 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 + 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 - 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 + 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 8.1. Normative References . . . . . . . . . . . . . . . . . . 7 8.2. Informative References . . . . . . . . . . . . . . . . . 7 Appendix A. ESP Example . . . . . . . . . . . . . . . . . . . . 8 Appendix B. IKEv2 Example . . . . . . . . . . . . . . . . . . . 10 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 1. Introduction The Advanced Encryption Standard (AES - [FIPS-197]) has become the gold standard in encryption. Its efficient design, wide @@ -91,23 +91,23 @@ describes the IPsec-specific things. 1.1. Conventions Used in This Document 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. ChaCha20 & Poly1305 for ESP - AEAD_CHACHA20_POLY1305 is a combined mode algorithm, or AEAD. The - construction follows the AEAD construction in section 2.8 of - [RFC7539]: + AEAD_CHACHA20_POLY1305 ([RFC7539]) is a combined mode algorithm, or + AEAD. Usage follows the AEAD construction in section 2.8 of RFC + 7539: o The Initialization Vector (IV) is 64-bit, and is used as part of the nonce. The IV MUST be unique for each invocation for a particular SA but does not need to be unpredictable. The use of a counter or a linear feedback shift register (LFSR) is RECOMMENDED. o A 32-bit Salt is prepended to the 64-bit IV to form the 96-bit nonce. The salt is fixed per SA and it is not transmitted as part of the ESP packet. o The encryption key is 256-bit. o The Internet Key Exchange protocol generates a bitstring called @@ -150,23 +150,20 @@ o Zero octet padding that rounds the total length up to an integral multiple of 16 octets. o The length of the additional authenticated data (AAD) in octets (as a 64-bit integer encoded in little-endian byte order). o The length of the ciphertext in octets (as a 64-bit integer encoded in little-endian byte order). The 128-bit output of Poly1305 is used as the tag. All 16 octets are included in the packet. - The encryption algorithm transform ID for negotiating this algorithm - in IKE is ENCR_CHACHA20_POLY1305 (number is TBA by IANA). - The figure below is copied from RFC 4303: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Security Parameters Index (SPI) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--- | IV (optional) | ^ p @@ -219,25 +218,25 @@ explicitly in the Encrypted payload. o The sender SHOULD include no padding and set the Pad Length field to zero. The receiver MUST accept any length of padding. o The AAD is as described in section 5.1 of RFC 5282, so it is 32 octets (28 for the IKEv2 header + 4 octets for the encrypted payload header) assuming no unencrypted payloads. 4. Negotiation in IKEv2 When negotiating the ChaCha20-Poly1305 algorithm for use in IKE or - IPsec, the value xxx (TBA by IANA) should be used in the transform - substructure of the SA payload as the ENCR (type 1) transform ID. As - with other AEAD algorithms, INTEG (type 3) transform substructures - MUST NOT be specified or just one INTEG transform MAY be included - with value NONE (0). + IPsec, the value ENCR_CHACHA20_POLY1305 (28) should be used in the + transform substructure of the SA payload as the ENCR (type 1) + transform ID. As with other AEAD algorithms, INTEG (type 3) + transform substructures MUST NOT be specified or just one INTEG + transform MAY be included with value NONE (0). 5. Security Considerations The ChaCha20 cipher is designed to provide 256-bit security. The Poly1305 authenticator is designed to ensure that forged messages are rejected with a probability of 1-(n/(2^102)) for a 16n-octet message, even after sending 2^64 legitimate messages, so it is SUF- CMA in the terminology of [AE]. @@ -255,23 +254,24 @@ The Salt value in used nonce construction in ESP and IKEv2 is derived from the keystream, same as the encryption key. It is never transmitted on the wire, but the security of the algorithm does not depend on its secrecy. Thus implementations that keep keys and other secret material within some security boundary MAY export the Salt from the security boundary. This may be useful if the API provided by the library accepts the nonce as parameter rather than the IV. 6. IANA Considerations - IANA is requested to assign one value from the IKEv2 "Transform Type - 1 - Encryption Algorithm Transform IDs" registry, with name - ENCR_CHACHA20_POLY1305, and this document as reference for both ESP + IANA has assigned the value 28 as a transform identifier for the + algorithm described in this document in the "Transform Type 1 - + Encryption Algorithm Transform IDs" registry with name + ENCR_CHACHA20_POLY1305 and this document as reference for both ESP and IKEv2. 7. Acknowledgements All of the algorithms in this document were designed by D. J. Bernstein. The AEAD construction was designed by Adam Langley. The author would also like to thank Adam for helpful comments, as well as Yaron Sheffer for telling me to write the algorithms draft. Thanks also to Martin Willi for pointing out the discrepancy with the final version of the algorithm document, and to Valery Smyslov and Tero