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

This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/