RFC 7634

ChaCha20, Poly1305, and Their Use in the Internet Key Exchange Protocol (IKE) and IPsec

πŸ“… published August 2015, from ietf

ChaCha20, Poly1305, and Their Use in the Internet Key Exchange Protocol (IKE) and IPsec πŸŽ€

Internet Engineering Task Force (IETF) Β· Y. Nir, Check Point Β· Request for Comments: 7634 Β· Category: Standards Track Β· August 2015 Β· ISSN: 2070-1721

This one is a Standards Track RFC, so it's a real spec that implementers build against. It doesn't obsolete or update any other RFC. Yay for clean slates ✨

Abstract

okay so this doc is about pairing the ChaCha20 stream cipher with the Poly1305 authenticator, glued together into an AEAD algorithm πŸ”. It's made for IKEv2 and for IPsec πŸ’–

Status of This Memo

This is an Internet Standards Track document πŸ’…

It's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 5741 🌸

For the current status, any errata, and how to send feedback, look at http://www.rfc-editor.org/info/rfc7634 πŸ¦‹

Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved πŸŽ€

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stood on the publication date. Please actually read those, because they spell out your rights and restrictions. Any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as described in the Simplified BSD License βš–οΈ

Table of Contents

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
  1.1.  Conventions Used in This Document . . . . . . . . . . . .   3
2.  ChaCha20 and Poly1305 for ESP . . . . . . . . . . . . . . . .   3
  2.1.  AAD Construction  . . . . . . . . . . . . . . . . . . . .   5
3.  Use in IKEv2  . . . . . . . . . . . . . . . . . . . . . . . .   6
4.  Negotiation in IKEv2  . . . . . . . . . . . . . . . . . . . .   6
5.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   7
7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   7
  7.1.  Normative References  . . . . . . . . . . . . . . . . . .   7
  7.2.  Informative References  . . . . . . . . . . . . . . . . .   8
Appendix A.  ESP Example  . . . . . . . . . . . . . . . . . . . .   9
Appendix B.  IKEv2 Example  . . . . . . . . . . . . . . . . . . .  11
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  13
Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  13

1. Introduction 🌸

okay bestie, let's set the scene 🎬 AES [FIPS-197] is basically the go-to encryption algorithm now. It's the most commonly used one in lots of places, IPsec VPNs included πŸ” On most modern platforms AES is anywhere from four to ten times as fast as the old favorite, Triple Data Encryption Standard (3DES) [SP800-67]. 3DES also uses a 64-bit block, which means there's a cap on how much data you can encrypt before you're forced to rekey. So between speed and that cap, AES isn't just the best pick, it's the only viable one for IPsec πŸ‘‘

Here's the problem 😬 If future cryptanalysis finds a weakness in AES, VPN users are in a really rough spot. The only other widely supported IPsec cipher is the much slower 3DES, so switching IPsec installations away from AES isn't really feasible. [Standby-Cipher] goes deeper into this issue and why we need a standby cipher 🧠

So this doc proposes the fast and secure ChaCha20 stream cipher as that standby πŸ¦‹ It's used as an Authenticated Encryption with Associated Data (AEAD) construction with the Poly1305 authenticator, for the Encapsulated Security Protocol (ESP) [RFC4303] and the Internet Key Exchange Protocol version 2 (IKEv2) [RFC7296]. The actual algorithms are described in a separate document, [RFC7539]. This one only covers the IPsec-specific stuff πŸ’–

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 and Poly1305 for ESP πŸ’…

AEAD_CHACHA20_POLY1305 ([RFC7539]) is a combined mode algorithm, aka an AEAD. Usage follows the AEAD construction in Section 2.8 of RFC 7539, and here's the vibe:

  • The Initialization Vector (IV) is 64 bits and it's used as part of the nonce. The IV MUST be unique for each invocation for a particular security association (SA), but it does NOT need to be unpredictable πŸ™ˆ Using a counter or a linear feedback shift register (LFSR) is RECOMMENDED πŸ”’
  • A 32-bit Salt gets prepended to the 64-bit IV to form the 96-bit nonce. The salt is fixed per SA, and it's not sent as part of the ESP packet 🀫
  • The encryption key is 256 bits πŸ”‘
  • The Internet Key Exchange Protocol generates a bitstring called KEYMAT using a pseudorandom function (PRF). That KEYMAT gets split into keys for encryption, message authentication, and whatever else is needed. The KEYMAT requested for each ChaCha20-Poly1305 key is 36 octets. The first 32 octets are the 256-bit ChaCha20 key, and the remaining 4 octets are used as the Salt value in the nonce 🧁

The ChaCha20 encryption algorithm needs these parameters: a 256-bit key, a 96-bit nonce, and a 32-bit Initial Block Counter. For ESP, here's how we set them up πŸŽ€

  • The key is set as mentioned above πŸ—οΈ
  • The 96-bit nonce is a concatenation of the 32-bit Salt and the 64-bit IV, as described above 🧩
  • The Initial Block Counter is set to one (1). Why one and not zero? Because zero is reserved for generating the one-time Poly1305 key (see below) πŸ€“

As the ChaCha20 block function isn't applied directly to the plaintext, no padding should be necessary. Still, to keep in line with RFC 4303, the plaintext always has a pad length octet and a Next Header octet, and it may need padding octets so the buffer lines up to an integral multiple of 4 octets 🌈

The same key and nonce, along with a block counter of zero, get passed to the ChaCha20 block function, and the top 256 bits of the result become the Poly1305 key πŸ”

Finally, the Poly1305 function runs on the data to be authenticated. As specified in Section 2.8 of [RFC7539], that's a concatenation of the following, in this order 🧡

  • The Authenticated Additional Data (AAD); see Section 2.1.
  • Zero-octet padding that rounds the length up to 16 octets. This is 4 or 8 octets depending on the length of the AAD.
  • The ciphertext.
  • Zero-octet padding that rounds the total length up to an integral multiple of 16 octets.
  • The length of the AAD in octets (as a 64-bit integer encoded in little-endian byte order).
  • 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, and all 16 octets get included in the packet 🏷️

Here's the figure. It's a copy of Figure 2 in RFC 4303, so it's a bit of a mood πŸ“¦

  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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | a
|                    Rest of Payload Data  (variable)           | | y
~                                                               ~ | l
|                                                               | | o
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | a
|               |         TFC Padding * (optional, variable)    | v d
+-+-+-+-+-+-+-+-+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---
|                         |        Padding (0-255 bytes)        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |  Pad Length   | Next Header   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Integrity Check Value-ICV   (variable)                |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Now the fields, in bullet form πŸ“

  • The IV field is 64 bits. It's the final 64 bits of the 96-bit nonce. If the counter method is used for generating unique IVs, then the final 32 bits of the IV will equal the Sequence Number field πŸ”
  • The length of the Padding field need not exceed 4 octets. However, neither RFC 4303 nor this specification require using the minimal padding length πŸ™ƒ
  • The Integrity Check Value field contains the 16-octet tag πŸ’œ

2.1. AAD Construction 🧩

The Additional Authenticated Data (AAD) is built similarly to the one in [RFC4106] πŸŽ€

  • For security associations (SAs) with 32-bit sequence numbers, the AAD is 8 octets: a 4-octet SPI, followed by a 4-octet sequence number, ordered exactly as it is in the packet πŸ“¦
  • For SAs with an Extended Sequence Number (ESN), the AAD is 12 octets: a 4-octet SPI, followed by an 8-octet sequence number as a 64-bit integer in big-endian byte order 🌟

5. Security Considerations ✨

okay this section is the one you do NOT skip, bestie πŸš¨πŸ”’

The ChaCha20 cipher is designed to provide 256-bit security πŸ’ͺπŸ”

The Poly1305 authenticator is designed so forged messages get rejected with a probability of 1-(n/(2^102)) for a 16n-octet message πŸ™…β€β™€οΈ and that still holds even after sending 2^64 legitimate messages 🀯 That makes it SUF-CMA (strong unforgeability against chosen-message attacks) in the terminology of [AE]. Iconic. πŸ’…

The biggest security thing when you implement this document is making sure the nonce used in ChaCha20 is unique πŸ”‘ The nonce should be selected uniquely for a particular key, but it does not need to be unpredictable. Counters and LFSRs are both totally fine ways to generate unique nonces πŸŽ€

Another thing to watch is avoiding side channels πŸ‘€ For ChaCha20 this is trivial, but Poly1305 needs some extra care 🧼 You can find the implementation considerations for these algorithms in [RFC7539]. Read it, periodt πŸ“–

The Salt value in the nonce construction used in ESP and IKEv2 is derived from the keystream, same as the encryption key 🌈 It never goes out on the wire, but the security of the algorithm does not depend on it staying secret 🀫 So implementations that keep keys and other secret material inside a security boundary MAY export the Salt from that boundary πŸ¦‹ This can be useful if the library's API takes the nonce as a parameter instead of the IV 🧚

⚠️ Keep the nonce unique per key. That is the whole game, no cap.

6. IANA Considerations 🌸

IANA has assigned the value 28 as a transform identifier for the algorithm in this document πŸŽ‰ It lives in the "Transform Type 1 - Encryption Algorithm Transform IDs" registry under the name ENCR_CHACHA20_POLY1305, and this document is the reference for both ESP and IKEv2 πŸ’œ


7. References πŸ“š

7.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,
           <http://www.rfc-editor.org/info/rfc2119>.

[RFC4303]  Kent, S., "IP Encapsulating Security Payload (ESP)",
           RFC 4303, DOI 10.17487/RFC4303, December 2005,
           <http://www.rfc-editor.org/info/rfc4303>.

[RFC5282]  Black, D. and D. McGrew, "Using Authenticated Encryption
           Algorithms with the Encrypted Payload of the Internet Key
           Exchange version 2 (IKEv2) Protocol", RFC 5282,
           DOI 10.17487/RFC5282, August 2008,
           <http://www.rfc-editor.org/info/rfc5282>.

[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, <http://www.rfc-editor.org/info/rfc7296>.

[RFC7539]  Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF
           Protocols", RFC 7539, DOI 10.17487/RFC7539, May 2015,
           <http://www.rfc-editor.org/info/rfc7539>.

7.2. Informative References 🧠

[AE]       Bellare, M. and C. Namprempre, "Authenticated Encryption:
           Relations among notions and analysis of the generic
           composition paradigm", DOI 10.1007/s00145-008-9026-x,
           September 2008,
           <http://cseweb.ucsd.edu/~mihir/papers/oem.html>.

[FIPS-197]
           National Institute of Standards and Technology, "Advanced
           Encryption Standard (AES)", FIPS PUB 197, November 2001,
           <http://csrc.nist.gov/publications/fips/fips197/
           fips-197.pdf>.

[RFC1761]  Callaghan, B. and R. Gilligan, "Snoop Version 2 Packet
           Capture File Format", RFC 1761, DOI 10.17487/RFC1761,
           February 1995, <http://www.rfc-editor.org/info/rfc1761>.

[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,
           <http://www.rfc-editor.org/info/rfc4106>.

[SP800-67]
           National Institute of Standards and Technology,
           "Recommendation for the Triple Data Encryption Algorithm
           (TDEA) Block Cipher", FIPS SP800-67, January 2012,
           <http://csrc.nist.gov/publications/nistpubs/800-67-Rev1/
           SP-800-67-Rev1.pdf>.

[Standby-Cipher]
           McGrew, D., Grieco, A., and Y. Sheffer, "Selection of
           Future Cryptographic Standards", Work in Progress
           draft-mcgrew-standby-cipher-00, January 2013.

Appendix A. ESP Example πŸ§šβ€β™€οΈ

okay the vibes for this example are immaculate πŸ¦‹ We're using a tunnel-mode ESP SA with the ChaCha20-Poly1305 algorithm πŸ’– Here's the keying material:

KEYMAT:
000  80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f  ................
016  90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f  ................
032  a0 a1 a2 a3                                      ....

Obviously not a great PRF πŸ™ˆ but it's just for the example. The first 32 octets are the key, and the final 4 octets (0xa0 0xa1 0xa2 0xa3) are the salt πŸ§‚ For the packet, we're sending an ICMP packet from 198.51.100.5 to 192.0.2.5 🌍

Source Packet:
000  45 00 00 54 a6 f2 00 00 40 01 e7 78 c6 33 64 05  E..T....@..x.3d.
016  c0 00 02 05 08 00 5b 7a 3a 08 00 00 55 3b ec 10  ......[z:...U;..
032  00 07 36 27 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13  ..6'............
048  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23  ............ !"#
064  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33  $%&'()*+,-./0123
080  34 35 36 37                                      4567

Here are the SA details πŸ“

  • The key and Salt are as above.
  • The SPI is 0x01 0x02 0x03 0x04.
  • The next sequence number is 5; ESN is not enabled.
  • The gateway IP address for this side is 203.0.113.153; the peer address is 203.0.113.5.
  • NAT was not detected.

The 64-bit IV is 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 πŸŽ€ Put the salt and IV together and you get the nonce:

The nonce:
000  a0 a1 a2 a3 10 11 12 13 14 15 16 17              ............

The plaintext we encrypt is the source IP packet plus the padding 🧁

Plaintext (includes padding and pad length):
000  45 00 00 54 a6 f2 00 00 40 01 e7 78 c6 33 64 05  E..T....@..x.3d.
016  c0 00 02 05 08 00 5b 7a 3a 08 00 00 55 3b ec 10  ......[z:...U;..
032  00 07 36 27 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13  ..6'............
048  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23  ............ !"#
064  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33  $%&'()*+,-./0123
080  34 35 36 37 01 02 02 04                          4567....

Once we've got the key, nonce, and plaintext, we call the ChaCha20 function and encrypt the packet, which gives us the ciphertext ✨

Ciphertext:
000  24 03 94 28 b9 7f 41 7e 3c 13 75 3a 4f 05 08 7b  $..(..A~<.u:O..{
016  67 c3 52 e6 a7 fa b1 b9 82 d4 66 ef 40 7a e5 c6  g.R.......f.@z..
032  14 ee 80 99 d5 28 44 eb 61 aa 95 df ab 4c 02 f7  .....(D.a....L..
048  2a a7 1e 7c 4c 4f 64 c9 be fe 2f ac c6 38 e8 f3  *..|LOd.../..8..
064  cb ec 16 3f ac 46 9b 50 27 73 f6 fb 94 e6 64 da  ...?.F.P's....d.
080  91 65 b8 28 29 f6 41 e0                          .e.().A.

To calculate the tag, we need a one-time Poly1305 key πŸ” We get it by calling the ChaCha20 function again with the same key and nonce, but with a block count of zero 🧠

Poly1305 one-time key:
000  af 1f 41 2c c1 15 ad ce 5e 4d 0e 29 d5 c1 30 bf  ..A,....^M.)..0.
016  46 31 21 0e 0f ef 74 31 c0 45 4f e7 0f d7 c2 d1  F1!...t1.EO.....

The AAD is built by concatenating the SPI and the sequence number 🧩

000  01 02 03 04 00 00 00 05                          ........

The input to the Poly1305 function is made by concatenating and padding the AAD and the ciphertext πŸͺ„

Poly1305 Input:
000  01 02 03 04 00 00 00 05 00 00 00 00 00 00 00 00  ................
016  24 03 94 28 b9 7f 41 7e 3c 13 75 3a 4f 05 08 7b  $..(..A~<.u:O..{
032  67 c3 52 e6 a7 fa b1 b9 82 d4 66 ef 40 7a e5 c6  g.R.......f.@z..
048  14 ee 80 99 d5 28 44 eb 61 aa 95 df ab 4c 02 f7  .....(D.a....L..
064  2a a7 1e 7c 4c 4f 64 c9 be fe 2f ac c6 38 e8 f3  *..|LOd.../..8..
080  cb ec 16 3f ac 46 9b 50 27 73 f6 fb 94 e6 64 da  ...?.F.P's....d.
096  91 65 b8 28 29 f6 41 e0 00 00 00 00 00 00 00 00  .e.().A.........
112  08 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00  ........X.......

And the resulting tag is πŸ₯Ή

Tag:
000  76 aa a8 26 6b 7f b0 f7 b1 1b 36 99 07 e1 ad 43  v..&k.....6....C

Putting it all together, here's the final ESP packet πŸŽ‰

ESP packet:
000  45 00 00 8c 23 45 00 00 40 32 de 5b cb 00 71 99  E...#E..@2.[..q.
016  cb 00 71 05 01 02 03 04 00 00 00 05 10 11 12 13  ..q.............
032  14 15 16 17 24 03 94 28 b9 7f 41 7e 3c 13 75 3a  ....$..(..A~<.u:
048  4f 05 08 7b 67 c3 52 e6 a7 fa b1 b9 82 d4 66 ef  O..{g.R.......f.
064  40 7a e5 c6 14 ee 80 99 d5 28 44 eb 61 aa 95 df  @z.......(D.a...
080  ab 4c 02 f7 2a a7 1e 7c 4c 4f 64 c9 be fe 2f ac  .L..*..|LOd.../.
096  c6 38 e8 f3 cb ec 16 3f ac 46 9b 50 27 73 f6 fb  .8.....?.F.P's..
112  94 e6 64 da 91 65 b8 28 29 f6 41 e0 76 aa a8 26  ..d..e.().A.v..&
128  6b 7f b0 f7 b1 1b 36 99 07 e1 ad 43              k.....6....C

Appendix B. IKEv2 Example ✨

okay bestie, this is the IKEv2 example and it's giving full main character energy πŸ¦‹ we're using the same key as Appendix A, 0x80..0x9f, so it's literally the same key πŸ”‘ and the Salt is 0xa0 0xa1 0xa2 0xa3 🌸

the IV is also the same as the last example, and since the IV and Salt are both the same, the nonce is also the same. iykyk πŸ™ˆ

because the key and nonce are the same, the one-time Poly1305 key is also the same. no cap, it's consistent πŸ’…

the packet is an INFORMATIONAL request with one payload: a Notify payload with type SET_WINDOW_SIZE, setting the window size to 10 πŸŽ€

here are the SPIs:

  • iSPI = 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 πŸ’œ
  • rSPI = 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 🩷

and the Message ID shall be 9 πŸ“

The Notify Payload:

000  00 00 00 0c 00 00 40 01 00 00 00 0a              ......@.....

Plaintext (with no padding and a zero pad length):

000  00 00 00 0c 00 00 40 01 00 00 00 0a 00           ......@......

Ciphertext:

000  61 03 94 70 1f 8d 01 7f 7c 12 92 48 89           a..p....|..H.

the AAD is built by appending the IKE header to the encrypted payload header 🧚 ngl this part is important: the length field in the IKE header and the length field in the encrypted payload header have to be calculated before you build the AAD ✨

AAD:

000  c0 c1 c2 c3 c4 c5 c6 c7 d0 d1 d2 d3 d4 d5 d6 d7  ................
016  2e 20 25 00 00 00 00 09 00 00 00 45 29 00 00 29  . %........E)..)

the AAD length is an integral multiple of 16, so when you build the input to Poly1305 there's no padding needed 🫢 the ciphertext is 13 octets, so it gets followed by 3 zero octets. the input to Poly1305 is 32 octets of AAD, 13 octets of ciphertext, 3 octets of zero padding, and then two 8-octet length fields in little-endian byte order. slay πŸ‘‘

Poly1305 Input:

000  c0 c1 c2 c3 c4 c5 c6 c7 d0 d1 d2 d3 d4 d5 d6 d7  ................
016  2e 20 25 00 00 00 00 09 00 00 00 45 29 00 00 29  . %........E)..)
032  61 03 94 70 1f 8d 01 7f 7c 12 92 48 89 00 00 00  a..p....|..H....
048  20 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00   ...............

Tag:

000  6b 71 bf e2 52 36 ef d7 cd c6 70 66 90 63 15 b2  kq..R6....pf.c..

Encrypted Payload:

000  29 00 00 29 10 11 12 13 14 15 16 17 61 03 94 70  )..)........a..p
016  1f 8d 01 7f 7c 12 92 48 89 6b 71 bf e2 52 36 ef  ....|..H.kq..R6.
032  d7 cd c6 70 66 90 63 15 b2                       ...pf.c..

The IKE Message:

000  c0 c1 c2 c3 c4 c5 c6 c7 d0 d1 d2 d3 d4 d5 d6 d7  ................
016  2e 20 25 00 00 00 00 09 00 00 00 45 29 00 00 29  . %........E)..)
032  10 11 12 13 14 15 16 17 61 03 94 70 1f 8d 01 7f  ........a..p....
048  7c 12 92 48 89 6b 71 bf e2 52 36 ef d7 cd c6 70  |..H.kq..R6....p
064  66 90 63 15 b2                                   f.c..

now the snoop file πŸŽ€ it's in the snoop format [RFC1761] and it has three packets. the first is the ICMP packet from Appendix A, the second is the ESP packet from that same appendix, and the third is the IKEv2 packet from this appendix. to turn this text back into a file, you can use a Unix command line tool like "openssl enc -d -a":

c25vb3AAAAAAAAACAAAABAAAAGIAAABiAAAAegAAAABVPq8PAAADVdhs6fUQBHgx
wbcpwggARQAAVKbyAABAAed4xjNkBcAAAgUIAFt6OggAAFU77BAABzYnCAkKCwwN
Dg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3AAAAmgAA
AJoAAACyAAAAAFU+rw8AAAo62Gzp9RAEeDHBtynCCABFAACMI0UAAEAy3lvLAHGZ
ywBxBQECAwQAAAAFEBESExQVFhckA5QouX9BfjwTdTpPBQh7Z8NS5qf6sbmC1Gbv
QHrlxhTugJnVKETrYaqV36tMAvcqpx58TE9kyb7+L6zGOOjzy+wWP6xGm1Anc/b7
lOZk2pFluCgp9kHgdqqoJmt/sPexGzaZB+GtQwAAAG8AAABvAAAAhwAAAABVPq8P
AAARH9hs6fUQBHgxwbcpwggARQAAYSNFAABAEd6nywBxmcsAcQUB9AH0AE0IUcDB
wsPExcbH0NHS09TV1tcuICUAAAAACQAAAEUpAAApEBESExQVFhdhA5RwH40Bf3wS
kkiJa3G/4lI279fNxnBmkGMVsg==

Acknowledgements πŸ’–

all of the algorithms in this document were designed by D. J. Bernstein 🌈 the AEAD construction was designed by Adam Langley. the author also wants to thank Adam for helpful comments, and Yaron Sheffer for telling them to write the algorithms document 🫢 thanks also to Martin Willi for pointing out the discrepancy with the final version of the algorithm document, and to Valery Smyslov and Tero Kivinen for helpful comments on this document. thanks to Steve Doyle and Martin Willi for pointing out mistakes in the examples πŸ™ˆ

Author's Address ✨

Yoav Nir Check Point Software Technologies Ltd. 5 Hasolelim St. Tel Aviv 6789735 Israel

Email: ynir.ietf@gmail.com πŸ’œ

πŸ“¦ where this page comes from