RFC 2419

The PPP DES Encryption Protocol, Version 2 (DESE-bis)

๐Ÿ“… published September 1998, from ietf

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 (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

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