RFC 2419
The PPP DES Encryption Protocol, Version 2 (DESE-bis)
RFC 2419 ๐ The PPP DES Encryption Protocol, Version 2 (DESE-bis) ๐
- Series: Network Working Group ๐ธ
- Authors: K. Sklower (University of California, Berkeley) and G. Meyer (Shiva) ๐ฏ
- Category: Standards Track ๐ฆ
- Date: September 1998 ๐
- Obsoletes: RFC 1969 (this one replaces it, bestie) โจ
Status of This Memo โจ
okay so this document specifies an Internet standards track protocol for the whole Internet community, and it's literally asking for discussion and suggestions ๐ฃ๏ธ If you want to know where this protocol sits in standardization and its current status, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐ Distribution of this memo is unlimited ๐
Copyright Notice ยฉ
Copyright (C) The Internet Society (1998). All Rights Reserved. ๐ซถ
Abstract ๐
okay bestie, the Point-to-Point Protocol (PPP) [1] is the standard way to move multi-protocol datagrams over point-to-point links ๐
The PPP Encryption Control Protocol (ECP) [2] is the part that lets two ends negotiate and use encryption protocols over PPP-encapsulated links ๐
This document gets into the specifics of using the DES standard [5, 6] to encrypt PPP-encapsulated packets ๐
Acknowledgements ๐
The authors gave a huge shoutout to Fred Baker of Cisco, Philip Rakity of Flowpoint, and William Simpson of Daydreamer for helping make the document clearer and more correct ๐
Table of Contents ๐๏ธ
1. Introduction ................................................ 2
1.1. Motivation ................................................ 2
1.2. Conventions ............................................... 2
2. General Overview ............................................ 2
3. Structure of This Specification ............................. 4
4. DESE Configuration Option for ECP ........................... 4
5. Packet Format for DESE ...................................... 5
6. Encryption .................................................. 6
6.1. Padding Considerations .................................... 7
6.2. Generation of the Ciphertext .............................. 8
6.3. Retrieval of the Plaintext ................................ 8
6.4. Recovery after Packet Loss ................................ 8
7. MRU Considerations .......................................... 9
8. Differences from RFC 1969 ................................... 9
8.1. When to Pad ............................................... 9
8.2. Assigned Numbers .......................................... 9
8.3. Minor Editorial Changes ................................... 9
9. Security Considerations ..................................... 9
10. References ................................................. 10
11. Authors' Addresses ......................................... 11
12. Full Copyright Statement ................................... 12
1. Introduction โจ
1.1. Motivation ๐ฏ
the purpose of this memo is twofold, lol ๐ First, it shows how to spell out the necessary details of a "data" or "bearer" protocol inside the context of the generic PPP Encryption Control Protocol. Second, it gives at least one commonly understood way to do secure data transmission between PPP implementations ๐
The DES encryption algorithm is well studied, well understood, and widely implemented ๐ The DES cipher was designed to be efficient in hardware, so it can be relatively expensive to implement in software. Still, it's so everywhere that it makes sense as a "model" encryption protocol ๐ธ
Source code implementing DES in the "Electronic Code Book Mode" can be found in [7]. Heads up though: US export laws forbid including compilation-ready source code in this document ๐
1.2. Conventions ๐
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 RFC 2119 [8] ๐
2. General Overview ๐
the whole point of encrypting packets between two PPP implementations is to try to keep their conversation private ๐คซ The process depends on an encryption algorithm and a shared secret (usually at least a key) that both sender and receiver have.
Basically, the encryptor takes a PPP packet, including its protocol field, runs the chosen algorithm on it, and puts the resulting cipher text in the information field of another PPP packet. In this specification, it also adds an explicit sequence number ๐ง The decryptor applies the inverse algorithm and treats the resulting plain text as if it had arrived directly on the interface ๐ซ
How the secret gets to both sides is out of scope for this document. Usually that's some kind of manual configuration ๐๏ธ Implementations might use PPP authentication, or the EndPoint Identifier Option described in PPP Multilink [3], to help pick the shared secret. And if someone can work out the secret by analyzing the communication between the two parties, then no privacy is guaranteed. Yikes ๐
The US Data Encryption Standard (DES) algorithm [5, 6] supports multiple modes, but this specification picks just one to use with the PPP Encryption Control Protocol (ECP): Cipher Block Chaining (CBC) mode ๐ Besides the US Government publications cited above, CBC mode is also discussed in [7], although no C source code is provided for it per se.
The initialization vector for this mode is worked out from an explicit 64-bit nonce, which gets exchanged in the clear during the negotiation phase ๐ท The 56-bit key that all DES modes need is set up as a shared secret between the implementations.
Why chaining? It's generally thought to take more computing power to figure out a 64-bit DES key by analyzing the encrypted stream when chaining is used, compared to when each block is encrypted separately with no chaining ๐ง Also, identical plaintext sequences produce different ciphers when chaining is in effect, which makes analysis way harder ๐
Here's the catch, though ๐ If chaining extends beyond packet boundaries, both the sender and receiver have to agree on the order the packets were encrypted in. So this specification adds an explicit 16-bit sequence number to keep the decryption of packets in order ๐ข This mode of operation can even recover from occasional packet loss. More details on that are given below โจ
3. Structure of This Specification ๐งฉ
The PPP Encryption Control Protocol (ECP) gives you a framework for negotiating encryption parameters, like choosing the algorithm ๐ ๏ธ It specifies the assigned numbers to be used as PPP protocol numbers for the "data packets" carried as the associated "data protocol", and it describes the state machine ๐ค
So a spec that plugs into that matrix only needs to describe any extra configuration options required for a particular algorithm, plus how to encrypt and decrypt the information once the Opened state has been reached ๐
4. DESE Configuration Option for ECP ๐
Description ๐ฌ
The ECP DESE Configuration Option says the issuing implementation is offering to use this specification to decrypt communications on the link. You can think of it as a request for its peer to encrypt packets this way too ๐
The ECP DESE Configuration Option has the following fields, transmitted from left to right:
Figure 1: ECP DESE Configuration Option
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 3 | Length | Initial Nonce ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type ๐ท๏ธ
Type = 3 means DESE-bis ๐ฆ The former value 1, which pointed at the previous DESE spec, is deprecated. In other words, systems implementing this specification MUST NOT offer the former value 1 in a configure-request, and MUST configure-reject the former value on receipt of a configure-request containing it ๐ซ
Length ๐
10
Initial Nonce ๐ฒ
This field is an 8 byte quantity. The peer implementation uses it to encrypt the first packet transmitted after the sender reaches the opened state ๐
To guard against replay attacks, the implementation SHOULD offer a different value during each ECP negotiation ๐ก๏ธ An example might be to use the number of seconds since Jan 1st, 1970 (GMT/UT) in the upper 32 bits, and the current number of nanoseconds relative to the last second mark in the lower 32 bits โฑ๏ธ
Its formulaic role is described in the Encryption section below โจ
5. Packet Format for DESE ๐ฆ
Description ๐
The DESE packets themselves have the following fields:
Figure 2: DES Encryption Protocol Packet Format
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address | Control | 0000 | Protocol ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Seq. No. High | Seq. No. Low | Ciphertext ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Address and Control ๐
These fields MUST be present unless the PPP Address and Control Field Compression option (ACFC) has been negotiated ๐ค
Protocol ID ๐
The value of this field is 0x53 or 0x55. The latter means the ciphertext includes headers for the Multilink Protocol, and it requires that the Individual Link Encryption Control Protocol has reached the opened state ๐ The leading zero MAY be absent if the PPP Protocol Field Compression option (PFC) has been negotiated โ๏ธ
Sequence Number ๐ข
These 16-bit numbers are assigned by the encryptor sequentially, starting with 0 for the first packet transmitted once ECP has reached the opened state ๐ฏ
Ciphertext ๐
The generation of this data is described in the next section ๐ซถ
6. Encryption โจ
okay bestie, once ECP hits the Opened state ๐, the sender MUST NOT encrypt LCP packets or ECP packets. they stay plain ๐ซถ
if the async control character map option was negotiated on the link ๐บ๏ธ, the sender does the mapping after the encryption algorithm has run. order matters, periodt ๐
the vibe of the algorithm: pad the Protocol and Information fields of a PPP packet out to a multiple of 8 bytes, then run DES in Chaining Block Cipher mode with a 56-bit key K ๐
ngl there are a LOT of details about what counts as the Protocol and Information fields ๐ฅน. it depends on whether Multilink is in play, whether ACFC and PFC were negotiated, and which kind of padding got picked. so many variables, no cap ๐ญ
no matter whether ACFC was negotiated, the sender only encrypts the part of the packet that isn't the address and control field ๐
if Multilink is negotiated and you're treating encryption as happening on each link separately ๐, then encryption goes over the (possibly extended) protocol and information fields inside the Multilink Protocol packet ๐ง
if Multilink is negotiated and you're treating encryption as happening on the bundle ๐ฆ, then the multilink procedure gets applied to the resulting DESE packets. the bundle version is giving main character energy โจ
6.1. Padding Considerations
okay so DES works on blocks of 8 octets ๐งฉ. that means plain text packets whose length isn't a multiple of 8 octets have to get padded. and that padding can mess with protocols that don't carry an explicit length field in their headers ๐ฌ. not iconic behavior at all
there's no standard list of which protocols are vulnerable to padding-induced corruption ๐, so people could get confused about which ones should be protected from it. so this spec says the unambiguous technique below MUST be applied to ALL plain text packets ๐. no picking and choosing, bestie
the padding method is based on the LCP Self-Describing-Padding (SDP) option (defined in RFC 1570 [4]) ๐. it's different in two ways ๐: first, the maximum pad value is fixed at 8, and second, the method applies to ALL packets, not just "specifically identified protocols" ๐
plain text that isn't a multiple of 8 octets long MUST be padded before encryption, using enough octets from the sequence 1, 2, 3 ... 7 to make it a multiple of 8 octets ๐ง
plain text that's already a multiple of 8 octets may still need an extra 8 octets (1, 2, 3 ... 8) ๐ณ. those extra octets MUST be appended before encryption if the last octet of the plain text has a value of 1 through 8, inclusive. yes it's a little bit of a plot twist ๐
after the peer decrypts the cipher text, it strips off the Self-Describing-Padding octets to get the original plain text back ๐ช
after decrypting, you only need to look at the last octet to figure out how many pad bytes to remove. but the peer SHOULD discard the frame if all the octets forming the padding don't match the scheme we just described. that's a red flag, bestie ๐ฉ
the padding operation above happens independently of whether the LCP Self-Describing-Padding (SDP) option was negotiated ๐ โโ๏ธ. if SDP was negotiated, it gets applied to the whole packet after it's been ciphered and after the Encryption Protocol Identifiers have been prepended ๐ง
6.2. Generation of the Ciphertext
alright, the math moment ๐ค๐ซง. E[k] is the basic DES cipher using a 56-bit key k on 64-bit blocks, and D[k] is the matching decryption ๐. the padded plaintext from the last section becomes a sequence of 64-bit blocks P[i] (where i goes from 1 to n) ๐งฑ. the circumflex character (^) means bit-wise exclusive-or on 64-bit blocks โ๏ธ
when you encrypt the first packet sent in the opened state, C[0] is E[k] applied to the Initial Nonce from the peer's ECP DESE option ๐ฑ. otherwise, C[0] is the final block of the previously sent packet ๐
the ciphertext for the packet comes out of this iterative process, for i running from 1 to n:
C[i] = E[k](P[i] ^ C[i-1])
6.3. Retrieval of the Plaintext
decrypting the first packet received in the opened state ๐ฌ: C[0] is E[k] applied to the Initial Nonce sent in the ECP DESE option ๐ธ. that first packet has sequence number zero. for every packet after that, C[0] is the final block of the previous packet in sequence space ๐งต
then decryption is just this, for i running from 1 to n:
P[i] = C[i-1] ^ D[k](C[i]),
6.4. Recovery after Packet Loss
packet loss gets detected when the sequence numbers of consecutive packets don't line up ๐ต๏ธโโ๏ธ. say packet number N - 1 has an unrecoverable error or gets lost, but packets N and N + 1 arrive fine ๐ฆ๐ฆ
here's the tea โ: packet N needs C[0] to be C[last] from packet N - 1. since that's missing, packet N can't be decoded ๐ญ. BUT packet N + 1 and everything after it can still be decoded the usual way, because all you need is the last block of ciphertext from the previous packet (here, packet N, which WAS received) ๐ฅฐ. the chain heals itself, iconic
7. MRU Considerations
padding can happen, and there's an extra protocol field in play, so implementations should take the growth of packets into account ๐. example time ๐: say PFC was negotiated and the MRU used to be exactly a multiple of 8. a full-sized data packet plus a one-byte protocol field would need an extra 7 bytes of padding ๐ต. and the sequence number adds 2 more bytes. so the information field in the DESE protocol ends up 10 bytes bigger than the original packet's ๐
PPP options are independent of each other by convention, so negotiating DESE doesn't automatically bump up the MRU value by itself ๐ โโ๏ธ. you gotta handle that separately, bestie ๐
8. Differences from RFC 1969
8.1. When to Pad
in RFC 1969, Self-Describing Padding wasn't applied to all packets sent using DESE ๐. following the SDP option's own method, only "specifically identified protocols" got padded, and protocols with an explicit length identifier were exempt. (examples were non-VJ-compressed IP, XNS, and CLNP) ๐ง
in this specification, the method applies to ALL packets ๐
also, this spec is clarified as completely independent of the Self-Describing-Padding option for PPP, and the maximum number of padding octets is fixed at 8 ๐
8.2. Assigned Numbers
since this specification could theoretically make a packet sent under the previous specification get misread ๐ฌ, a new type field number has been assigned for the DESE-bis protocol ๐ท๏ธ
8.3. Minor Editorial Changes
this spec has been designated a standards track document ๐ค๏ธ. some other language was also tweaked for clarity โจ
9. Security Considerations
okay this section is SERIOUS, bestie ๐จ๐ read it carefully
this proposal is only concerned with providing confidentiality ๐ค. it doesn't describe any mechanisms for integrity, authentication, or nonrepudiation ๐ โโ๏ธ. it doesn't guarantee that a message received hasn't been modified in transit through replay, cut-and-paste, or active tampering ๐ฑ. it doesn't authenticate the source of any packet received, and it doesn't stop the sender of a packet from denying they wrote it ๐
this proposal relies on exterior and unspecified methods for authenticating and retrieving shared secrets ๐๏ธ. it doesn't propose any new privacy technology. it just describes a convention for applying the DES cipher to data transmission between PPP implementations ๐ก
any methodology for protecting and retrieving shared secrets, and any limitations of the DES cipher, are relevant to the use described here โ ๏ธ. so keep those in mind, lovely ๐ซถ
reminder: confidentiality is the ONLY thing this gives you. no integrity, no authentication, no nonrepudiation. don't mix that up ๐
10. References
[1] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994. ๐
[2] Meyer, G., "The PPP Encryption Protocol (ECP)", RFC 1968, June 1996. ๐
[3] Sklower, K., Lloyd, B., McGregor, G., Carr, D., and T. Coradetti, "The PPP Multilink Protocol (MP)", RFC 1990, August 1996. ๐
[4] Simpson, W., Editor, "PPP LCP Extensions", RFC 1570, January 1994. ๐
[5] National Bureau of Standards, "Data Encryption Standard", FIPS PUB 46 (January 1977). ๐งฎ
[6] National Bureau of Standards, "DES Modes of Operation", FIPS PUB 81 (December 1980). ๐งต
[7] Schneier, B., "Applied Cryptography - Protocols Algorithms, and source code in C", John Wiley & Sons, Inc. 1994. There is an errata associated with the book, and people can get a copy by sending e-mail to schneier@counterpane.com. ๐
[8] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐ซง
11. Authors' Addresses
Keith Sklower
Computer Science Department
339 Soda Hall, Mail Stop 1776
University of California
Berkeley, CA 94720-1776
Phone: (510) 642-9587
EMail: sklower@CS.Berkeley.EDU
Gerry M. Meyer
Cisco Systems Ltd.
Bothwell House, Pochard Way,
Strathclyde Business Park,
Bellshill, ML4 3HB
Scotland, UK
Phone: (UK) (pending)
Fax: (UK) (pending)
Email: gemeyer@cisco.com
12. Full Copyright Statement
Copyright (C) The Internet Society (1998). All Rights Reserved. ๐
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. ๐
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. โพ๏ธ
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐ซถ
๐ฆ where this page comes from
- ietf: rfc2419 1998-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms