RFC 3078
Microsoft Point-To-Point Encryption (MPPE) Protocol
Status of This Memo โจ
okay so this part is basically the disclaimer ๐ It's info for the Internet community, not an Internet standard of any kind, and distribution is unlimited. Totally shareable, bestie ๐
Copyright Notice ๐
Copyright (C) The Internet Society (2001). All Rights Reserved.
Abstract ๐ฆ
okay so PPP (Point-to-Point Protocol) is the standard way to send multi-protocol datagrams over point-to-point links ๐ Then there's the PPP Compression Control Protocol, which lets you negotiate and use compression over PPP-encapsulated links.
This doc is about Microsoft Point to Point Encryption (MPPE), which is how you make PPP-encapsulated packets more confidential ๐ It's giving privacy glow-up.
Specification of Requirements ๐ธ
so the key words "MAY", "MUST", "MUST NOT", optional, recommended, "SHOULD", and "SHOULD NOT" get interpreted as described in [5]. Just keep that in mind as you read, because the caps are doing real work here ๐ซถ
1. Introduction โจ
okay so MPPE is a way of representing PPP packets in an encrypted form. It's literally the whole vibe ๐ง
MPPE uses the RSA RC4 [3] algorithm for data confidentiality. The length of the session key used to initialize the encryption tables can be negotiated ๐ Right now MPPE supports 40-bit and 128-bit session keys.
MPPE session keys change frequently ๐ How often depends on the options you negotiated, and it could be every packet. Iconic, honestly ๐ฅ
MPPE is negotiated within option 18 [4] in the Compression Control Protocol ๐
2. Configuration Option Format ๐
Description
The CCP Configuration Option is what negotiates MPPE on the link โจ By default (so if MPPE negotiation isn't even attempted), no encryption is used ๐ But if MPPE negotiation is attempted and it fails, the link SHOULD be terminated ๐
Here's a summary of the CCP Configuration Option format. The fields go left to right ๐
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 | Length | Supported Bits |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Supported Bits |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type
It's 18 ๐
Length
It's 6 ๐
Supported Bits
This field is 4 octets, most significant octet first ๐
3 2 1
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |H| |M|S|L|D| |C|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the 'C' bit is used by MPPC [4], and this memo doesn't go into it further ๐ The 'D' bit is obsolete ๐ฅ Some older peers might still try to negotiate it, but it SHOULD NOT be accepted. If the 'L' bit is set (that's 0x20 in the least significant octet), the sender wants to negotiate 40-bit session keys. If the 'S' bit is set (0x40 in the least significant octet), the sender wants 128-bit session keys ๐ฅ If the 'M' bit is set (0x80 in the least significant octet), the sender wants 56-bit session keys. If the 'H' bit is set (0x01 in the most significant octet), the sender wants to negotiate stateless mode, where the session key changes after each packet is sent (see section 10, below) โจ In the rest of the doc, the 'S', 'M' and 'L' bits get called "encryption options" collectively ๐
All other bits are reserved and MUST be set to 0. Non-negotiable, bestie ๐
2.1. Option Negotiation ๐ฆ
MPPE options get negotiated as described in [2]. The negotiation initiator SHOULD request all of the options it supports ๐ซถ The responder SHOULD NAK with a single encryption option. Stateless mode can always be negotiated, though, independent of and in addition to an encryption option ๐ง If the responder supports more than one encryption option from the set the initiator asked for, the option it picks SHOULD be the "strongest" one offered ๐ช Informally, the MPPE encryption options rank like this:
STRONGEST
128-bit encryption ('S' bit set)
56-bit encryption ('M' bit set)
40-bit encryption ('L' bit set)
WEAKEST
this ranking takes into account how generally accepted the cipher's strength is ๐ง
The initiator SHOULD then either send another request with the same option(s) as the responder's NAK, or cancel the negotiation and drop the connection ๐ โโ๏ธ
3. MPPE Packets ๐ธ
okay so before any MPPE packets get sent, PPP MUST reach the Network-Layer Protocol phase, and the CCP Control Protocol MUST reach the Opened state ๐ฆ
Exactly one MPPE datagram gets encapsulated in the PPP Information field ๐ The PPP Protocol field says type 0x00FD for all encrypted datagrams ๐
The maximum length of an MPPE datagram sent over a PPP link is the same as the maximum length of the Information field of a PPP encapsulated packet ๐
Only packets with PPP Protocol numbers from 0x0021 to 0x00FA get encrypted ๐ Everything else doesn't go through the MPPE processor and gets sent with its original PPP Protocol number.
Padding
It's recommended that padding not be used with MPPE ๐ If the sender does use padding, it MUST negotiate the Self-Describing-Padding Configuration option [10] during the LCP phase and use self-describing pads ๐งพ
Reliability and Sequencing
MPPE doesn't need a reliable link ๐ Instead, it relies on a 12-bit coherency count in each packet to keep the encryption tables in sync ๐ If stateless mode hasn't been negotiated and the coherency count in a received packet doesn't match the expected count, the receiver MUST send a CCP Reset-Request packet to resync the RC4 tables ๐จ
MPPE expects packets to arrive in sequence ๐ฌ
MPPE MAY be used over a reliable link, as described in "PPP Reliable Transmission" [6]. Honestly though, that usually just adds unnecessary overhead, since only the coherency count is needed ๐
Data Expansion
MPPE doesn't expand or compress data ๐ซง The number of octets going into and coming out of the MPPE processor is the same.
3.1. Packet Format ๐ง
Here's a summary of the MPPE packet format. Fields go left to right ๐
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PPP Protocol |A|B|C|D| Coherency Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Encrypted Data...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
PPP Protocol
The PPP Protocol field is described in the Point-to-Point Protocol Encapsulation [1] ๐
When MPPE gets successfully negotiated by the PPP Compression Control Protocol, the value of this field is 0x00FD โจ This value MAY be compressed when Protocol-Field-Compression is negotiated.
Bit A
This bit says the encryption tables were initialized before this packet was generated ๐ง The receiver MUST re-initialize its tables with the current session key before decrypting this packet. This bit is called the FLUSHED bit in this doc ๐ฟ If the stateless option has been negotiated, this bit MUST be set on every encrypted packet ๐ Also, MPPC and MPPE both recognize the FLUSHED bit, so if stateless is negotiated, it applies to both MPPC and MPPE ๐ฏโโ๏ธ
Bit B
This bit doesn't mean anything in MPPE ๐คทโโ๏ธ
Bit C
This bit doesn't mean anything in MPPE either ๐คทโโ๏ธ
Bit D
Setting this bit to 1 means the packet is encrypted ๐ Setting it to 0 means the packet is not encrypted.
Coherency Count
The coherency count makes sure packets are sent in the right order and that none got dropped ๐งฎ It's a monotonically increasing counter that goes up by 1 for each packet sent. When it hits 4095 (0x0FFF), it resets to 0 ๐
Encrypted Data
The encrypted data starts with the protocol field ๐ง For example, with an IP packet (0x0021 followed by an IP header), the MPPE processor encrypts the protocol field first and then encrypts the IP header.
If the packet has header compression, the MPPE processor is applied AFTER header compression is done, and it MUST be applied to the compressed header too ๐๏ธ For example, if a packet had protocol type 0x002D (for a compressed TCP/IP header), the MPPE processor would encrypt 0x002D first, then encrypt the compressed Van-Jacobson TCP/IP header ๐ซ
Implementation Note
If both MPPE and MPPC are negotiated on the same link, the sender MUST invoke the MPPE processor after the MPPC processor, and the receiver MUST invoke the MPPE processor before the MPPC processor ๐งฉ This order is super important, so don't skip it, bestie ๐ญ
4. Initial Session Keys ๐๏ธ
In the current implementation, initial session keys are derived from peer credentials. Other derivation methods are possible though ๐ท For example, some authentication methods (like Kerberos [8] and TLS [9]) produce session keys as a side effect of authentication, and those keys may be used by MPPE in the future ๐ That's why the techniques for deriving initial MPPE session keys are described in separate documents ๐
5. Initializing RC4 Using a Session Key ๐
Once an initial session key has been derived, the RC4 context gets initialized like this:
rc4_key(RC4Key, Length_Of_Key, Initial_Session_Key)
6. Encrypting Data ๐
Once it's initialized, data gets encrypted with the following function, then sent with the CCP and MPPE headers ๐ฆ
EncryptedData = rc4(RC4Key, Length_Of_Data, Data)
7. Changing Keys ๐ฆ
7.1. Stateless Mode Key Changes ๐
If stateless encryption has been negotiated, the session key changes every time the coherency count changes, which means on every packet ๐ In stateless mode, the sender MUST change its key before encrypting and transmitting each packet, and the receiver MUST change its key after receiving each packet but before decrypting it (see "Synchronization," below) ๐ซถ
7.2. Stateful Mode Key Changes โจ
okay bestie, so if stateful encryption got negotiated, the sender MUST change its key before encrypting and sending any packet where the low order octet of the coherency count equals 0xFF (that's the "flag" packet ๐ฉ). And the receiver MUST change its key after receiving it, but before decrypting it, a "flag" packet (see "Synchronization" below) ๐โจ
7.3. The MPPE Key Change Algorithm ๐งฎ
here's the method for changing keys, no cap it's kinda chef's kiss ๐
/*
* SessionKeyLength is 8 for 40-bit keys, 16 for 128-bit keys.
*
* SessionKey is the same as StartKey in the first call for
* a given session.
*/
void
GetNewKeyFromSHA(
IN unsigned char *StartKey,
IN unsigned char *SessionKey,
IN unsigned long SessionKeyLength
OUT unsigned char *InterimKey )
{
unsigned char Digest[20];
ZeroMemory(Digest, 20);
/*
* SHAInit(), SHAUpdate() and SHAFinal()
* are an implementation of the Secure
* Hash Algorithm [7]
*/
SHAInit(Context);
SHAUpdate(Context, StartKey, SessionKeyLength);
SHAUpdate(Context, SHApad1, 40);
SHAUpdate(Context, SessionKey, SessionKeyLength);
SHAUpdate(Context, SHApad2, 40);
SHAFinal(Context, Digest);
MoveMemory(InterimKey, Digest, SessionKeyLength);
}
next up, the RC4 tables get re-initialized using the brand new interim key ๐ธ
rc4_key(RC4Key, Length_Of_Key, InterimKey)
then the interim key gets encrypted using the new tables to make a new session key ๐ฆ
SessionKey = rc4(RC4Key, Length_Of_Key, InterimKey)
for 40-bit session keys, the most significant three octets of the new session key are now set to 0xD1, 0x26 and 0x9E respectively. for 56-bit keys, the most significant octet is set to 0xD1 ๐
last step, the RC4 tables get re-initialized using the new session key ๐
rc4_key(RC4Key, Length_Of_Key, SessionKey)
8. Synchronization ๐
packets can get lost in transfer, it happens ๐ญ so the next sections explain synchronization for both the stateless and stateful cases ๐ซถ
8.1. Stateless Synchronization ๐
if stateless encryption got negotiated and the coherency count in the received packet (C1) is greater than the coherency count in the last packet previously received (C2), the receiver MUST perform N = C1 - C2 key changes before decrypting the packet. that's so its session key stays in sync with the sender's session key ๐ Normally N is just 1, but if some packets in between got lost, N can be bigger than 1. for example, if C1 = 5 and C2 = 02 then N = 3 key changes are required ๐ง
since the FLUSHED bit is set on every packet when stateless encryption was negotiated, sending CCP Reset-Request packets is not required for synchronization โจ
8.2. Stateful Synchronization ๐
if stateful encryption got negotiated, the sender MUST change its key before encrypting and transmitting any packet where the low order octet of the coherency count equals 0xFF (the "flag" packet), and the receiver MUST change its key after receiving it, but before decrypting it. BUT the "flag" packet might get lost ๐ฑ if that happens, the low order octet of the coherency count in the received packet will be less than the one in the last packet previously received. in that case, the receiver MUST perform a key change before decrypting the newly received packet (because the sender already changed its key before sending that packet), and then send a CCP Reset-Request packet (see below) ๐
it's possible that 256 or more consecutive packets could be lost. the receiver SHOULD detect this condition and perform the number of key changes needed to resync with the sender ๐
if packet loss gets detected while using stateful encryption, the receiver MUST drop the packet and send a CCP Reset-Request packet without data. after sending that CCP Reset-Request packet, the receiver SHOULD silently discard all packets until a packet comes in with the FLUSHED bit set. when a packet with the FLUSHED bit set arrives, the receiver MUST set its coherency count to the one in that packet and re-initialize its RC4 tables using the current session key:
rc4_key(RC4Key, Length_Of_Key, SessionKey)
when the sender receives a CCP Reset-Request packet, it MUST re-initialize its own RC4 tables using the same method and set the FLUSHED bit in the next packet it sends. so synchronization gets achieved without a CCP Reset-Ack packet ๐ฆ๐
9. Security Considerations ๐
okay this section is serious, so read it carefully bestie ๐ฅบ
because of the way the RC4 tables get reinitialized during stateful synchronization, it's possible that two packets could be encrypted using the same key. for this reason, the stateful mode SHOULD NOT be used in lossy network environments (for example, layer two tunnels on the Internet) โ ๏ธ
since the MPPE negotiation is not integrity protected, an active attacker could change the strength of the keys in use by modifying the Supported Bits field of the CCP Configuration Option packet. the effects of this attack can be minimized through appropriate peer configuration, however ๐
Peers MUST NOT transmit user data until the MPPE negotiation is complete. no sending your secrets before the handshake is done, periodt ๐
it's possible that an active attacker could modify the coherency count of a packet, causing the peers to lose synchronization ๐ต
an active denial-of-service attack could be mounted by methodically inverting the value of the 'D' bit in the MPPE packet header ๐
10. References ๐
- [1] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.
- [2] Rand, D., "The PPP Compression Control Protocol (CCP)", RFC 1962, June 1996.
- [3] RC4 is a proprietary encryption algorithm available under license from RSA Data Security Inc. For licensing information, contact:
RSA Data Security, Inc.
100 Marine Parkway
Redwood City, CA 94065-1031
- [4] Pall, G., "Microsoft Point-to-Point Compression (MPPC) Protocol", RFC 2118, March 1997.
- [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [6] Rand, D., "PPP Reliable Transmission", RFC 1663, July 1994.
- [7] "Secure Hash Standard", Federal Information Processing Standards Publication 180-1, National Institute of Standards and Technology, April 1995.
- [8] Kohl, J. and C. Neuman "The Kerberos Network Authentication System (V5)", RFC 1510, September 1993.
- [9] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999.
- [10] Simpson, W., Editor, "PPP LCP Extensions", RFC 1570, January 1994.
11. Acknowledgements ๐ซถ
Anthony Bell, Richard B. Ward, Terence Spies and Thomas Dimitri, all of Microsoft Corporation, significantly contributed to the design and development of MPPE. the MPPE glow-up is because of them ๐
additional thanks to Robert Friend, Joe Davies, Jody Terrill, Archie Cobbs, Mark Deuser, and Jeff Haag, for useful feedback ๐
12. Authors' Addresses ๐ฎ
questions about this memo can be directed to:
Gurdeep Singh Pall
Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052
USA
Phone: +1 425 882 8080
Fax: +1 425 936 7329
EMail: gurdeep@microsoft.com
Glen Zorn
cisco Systems
500 108th Avenue N.E.
Suite 500
Bellevue, Washington 98004
USA
Phone: +1 425 438 8218
Fax: +1 425 438 1848
EMail: gwz@cisco.com
13. Full Copyright Statement โ๏ธ
Copyright (C) The Internet Society (2001). 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.
Acknowledgement ๐ท
Funding for the RFC Editor function is currently provided by the Internet Society ๐
๐ฆ where this page comes from
- ietf: rfc3078 2001-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms