PPTPV 2
PPTPV 2
1 Introduction
3a. The Client generates a random 16-byte number, called the “Peer Authenti-
cator Challenge.”
3b. The Client generates an 8-byte challenge by hashing the 16-byte challenge
received in step (2), the 16-byte Peer Authenticator Challenge generated in
step (3a), and the Client’s username. (See Section 3 for details.)
3c. The Client creates a 24-byte reply, using the Windows NT hash function
and the 8-byte challenge generated in step (3b). This process is identical to
MS-CHAPv1.
3d. The Client sends the Server the results of steps (3a) and (3c).
4a. The Server uses the hashes of the Client’s password, stored in a database, to
decrypt the replies. If the decrypted blocks match the challenge, the Client
is authenticated.
4b. The Server uses the 16-byte Peer Authenticator Challenge from the client,
as well as the Client’s hashed password, to create a 20-byte “Authenticator
Response.” (See Section 5 for details.)
5. The Client also computes the Authenticator Response. If the computed re-
sponse matches the received response, the Server is authenticated.
esses that plagued MS-CHAPv1. In MS-CHAPv1, two parallel hash values were
sent from the Client to the Server: the LAN Manager hash and the Windows
Cryptanalysis of Microsoft’s PPTP Authentication Extensions 195
NT hash. These were two different hashes of the same User password. The LAN
Manager hash is a much weaker hash function, and password-cracker programs
such as L0phtcrack were able to break the LAN Manager hash and then use that
information to break the Windows NT hash [L97]. By eliminating the LAN Ma-
nager hash in MS-CHAPv2, Microsoft has made this divide-and-conquer attack
impossible. Still, the security of this protocol is based on the password used, and
L0phtcrack can still break weak passwords using a dictionary attack [L99].
As we will discuss later, multiple layers of hashing are used in the different
steps of MS-CHAPv2. While this hashing serves to obscure some of the values,
it is unclear what the cryptographic significance of them are. All they seem to
do is to slow down the execution of the protocol.
We also have concerns over the amount of control the client has in the in-
fluence of the ultimate 8-byte challenge that is used, though we have not yet
been able to come up with a viable attack to exploit this. Certainly it opens the
possibility of subliminal channels, which can be exploited in other contexts.
3.1 Analysis
It is unclear to us why this protocol is so complicated. At first glance, it seems
reasonable that the Client not use the challenge from the Server directly, since it
is known to an eavesdropper. But instead of deriving a new challenge from some
secret information—the password hash, for example—the Client uses a unique
random number that is sent to the Server later in the protocol. There is no
reason why the Client cannot use the Server’s challenge directly and not use the
Peer Authenticator Challenge at all.
196 B. Schneier, Mudge, and D. Wagner
4.1 Analysis
This complicated procedure creates a serious weakness in the MS-CHAP proto-
cols: it allows the attacker to speed up dictionary keysearch by a factor of 216 ,
which is a pretty devastating effect given the relatively low entropy of most user
passwords.
Suppose that we eavesdrop on a MS-CHAP connection. The response R is
exposed in the clear, and the challenge C may be derived easily from public
information. We will attempt to recover the password, using the knowledge that
many passwords are closely derived from dictionary words or otherwise readily
guessable.
Note first that the value of Z can be easily recovered: since there are only 216
possibilities for Z, and we have a known plaintext-ciphertext pair C, DESZ (C)
for Z, we may try each of the possibilities for Z in turn with a simple trial
encryption1 . This discloses the last two bytes of the NT hash of the password.
We will use this observation to speed up dictionary search. In a one-time
precomputation, we hash each of our guesses at the password (perhaps as minor
variations on a list of words in a dictionary). We sort the results by the last two
bytes of their hash and burn this on a CD-ROM (or a small hard drive). Then,
when we see a MS-CHAP exchange, we may recover the last two bytes of the
NT hash (using the method outlined above) and examine all the corresponding
entries on the CD-ROM. This gives us a list of plausible passwords which have
the right value for the last two bytes of their NT hash; then we can try each of
those possibilities by brute force.
Suppose a naive dictionary attack would search N passwords. In our attack,
we try only the passwords which have the right value for the last two bytes of their
NT hash, so we expect to try only about N/216 passwords. This implies that the
optimized attack runs about 216 times faster than a standard dictionary attack,
if we can afford the space to store a precomputed list of possible passwords.
This attack is applicable to both MS-CHAPv1 and MS-CHAPv2. However,
the weakness is much more important for MS-CHAPv2, because for MS-CHAPv1
it is easier to attack the LanManager hash than to attack the NT hash.
This is a serious weakness which could have been easily avoided merely by
using a standard cryptographic hashing primitive. For instance, merely genera-
ting the response as R = SHA-1(NT hash, C) would be enough to prevent this
attack.
1
This has been independently observed by B. Rosenburg.
Cryptanalysis of Microsoft’s PPTP Authentication Extensions 197
Note also that the MS-CHAP response generation algorithm is also a weak
link, even when passwords contain adequate entropy. It is clear that the NT
hash can be recovered with just two DES exhaustive keysearches (about 256
trial DES decryptions on average), or in just 9 days using a single EFF DES
Cracker machine [Gil98]. Once the NT hash is recovered, all encrypted sessions
can be read and the authentication scheme can be cracked with no effort. This
shows that, even when using 128-bit RC4 keys, the MS-CHAP protocol provides
at most the equivalent of 57-bit security2 . This weakness could also have been
avoided by the simple change suggested above, R = SHA-1(NT hash, C).
It is not clear to us why the MS-CHAPv2 designers chose such a complicated
and insecure algorithm for generating 24-byte responses, when a simpler and
more secure alternative was available.
5.1 Analysis
Again, this process is much more complicated than required. There is no reason
to use SHA twice; a single hashing has the same security properties.
6 Analysis of MS-CHAPv2
We do not know why Microsoft chose such a complicated protocol, since this is
not stronger than the following:
1. The Server sends the Client an 8-byte challenge.
2
This has been independently observed by P. Holzer.
198 B. Schneier, Mudge, and D. Wagner
2. The Client encrypts the 16-byte local password hash with an 8-byte challenge
and sends the Server the 24-byte response, an 8-byte challenge of its own,
and the username.
3. The Server sends a pass/fail packet with a 24-byte response to the Client’s
challenge, which is the user’s password-hash-hash encrypted with the Client’s
8-byte challenge.
7 Changes to MPPE
stream cipher [Sch96], this created a cryptographic attack by XORing the two
streams against each other and performing standard cryptanalysis against the
result.
In the more recent version, the MPPE keys are derived from MS-CHAPv2
credentials and a unique key is used in each direction. The keys for each direc-
tion are still derived from the same value (the Client’s NT password hash), but
differently depending on the direction.
7.2 Analysis
This modification means that unique keys are used in each direction, but does
not solve the serious problem of weak keys. The keys are still a function of
the password, and hence contain no more entropy than the password. Even
though the RC4 algorithm may theoretically have 128-bits of entropy, the actual
passwords used for key generation have much less. This having been said, using
different keys in each direction is still a major improvement in the protocol.
200 B. Schneier, Mudge, and D. Wagner
We are very concerned with the magic constants embedded in the key derivation
algorithm for export-weakened keys.
The protocol weakens RC4 keys to 40 bits by fixing the high bits of the
64-bit RC4 key to 0xD1269E. But this seems dangerous. It is known that, if
an adversary is allowed to choose the high bits of the RC4 key, the adversary
can force you into a weak key class for RC4 [Roo95,Wag95]. Therefore, if the
MS-CHAP designers—or the NSA export-reviewer folks—wanted to embed a
trapdoor in the protocol, they could exploit the presence of magic constants to
weaken RC4.
We do not know whether keys prefixed with 0xD1269E are unusually weak,
but in our preliminary statistical tests we have found some suspicious properties
of such keys that leaves us with some cause for concern. To give two examples:
– Empirical measurements show that the first few bytes of output are biased,
for keys which start with 0xD1269E. The first and second keystream bytes
take on the values 0x09 and 0x00 with probabilities 0.0054 and 0.0060,
respectively. This is noticeably higher than the 1/256 = 0.0039 probability
you’d expect from good cipher.
– The key schedule mixes some entries in the state table poorly, for this class
of keys. For instance, S[1] = 0xF8 holds with probability 0.38 ≈ 1/e, and
S[2] = 0x98 holds with a similar probability.
In this section we present a very serious attack on the way that exportable 40-bit
session keys are generated. This weakness is also present in MS-CHAPv1 as well
as MS-CHAPv2, but it has not been discovered until now.
The end result is that the so-called “40-bit keys” really only have an effective
strength of about 26 bits. As a result, the export-weakened protocol can be
cracked in near-realtime with only a single computer3 .
3
Today’s computers seem to be able to try 216 –217 keys/second, which suggests that
each key can be cracked in something like a quarter of an hour. (In lieu of an
implementation, these estimates will necessarily be very rough.) With a small cluster
of computers, the cracking performance can be greatly increased.
Cryptanalysis of Microsoft’s PPTP Authentication Extensions 201
We recall that the key derivation process appends 40 secret bits (generated
in some way which is irrelevant to our attack) to the fixed value 0xD1269E. The
resulting 64-bit session key is to RC4-encrypt the transmitted data. The problem
is that this process introduces no per-session salt (compare to, e.g., SSL), and
thus can be broken with a time-space tradeoff attack.
For the remainder of this section, we assume that we can obtain a short
segment of known plaintext (40 bits should suffice) at some predictable location.
The known plaintext need not even occur at consecutive bit locations; the only
requirement is that the bit positions be predictable in advance. This seems to be
a very plausible assumption, when one considers the quantity of known headers
and other predictable data that is encrypted. Let us assume for simplicity of
description that this known plaintext occurs at the start of the keystream.
We will attack this protocol with a time-space tradeoff. The cost of a lengthy
precomputation is amortized over many sessions so that the incremental cost of
breaking each additional session key is reduced to a very low value.
A naive attacker might consider building a lookup table with 240 entries,
listing for each possible 40-bit key the value of the first 40 bits of keystream that
results. This requires a 240 precomputation, but then each subsequent session
key can be broken extremely quickly (with just a single table lookup). However,
in practice this attack is probably not very practical because it requires 240
space.
A time-space tradeoff allows us to reduce the space requirements of the naive
attack by trading off memory for additional computation. Consider Hellman’s
time-space tradeoff [Hel80]. For a n-bit key, Hellman’s tradeoff requires a 2n
precomputation and 22n/3 space, and then every subsequent session key can be
broken with just 22n/3 work. (Other tradeoffs are also possible.)
For MS-CHAP’s 40-bit keys, n = 40, and 2n/3 ≈ 26, so you get an attack
that breaks each session key with approximately 226 work. The attack requires
a 240 precomputation and 226 space, but these requirements are easily met.
This means that the export-weakened versions of MS-CHAP offer an effective
keylength of only about 26 bits or so, which is much less than the claimed 40
bits of strength. This is a deadly weakness.
9 Conclusions
Microsoft has improved PPTP to correct the major security weaknesses de-
scribed in [SM98]. However, the fundamental weakness of the authentication
and encryption protocol is that it is only as secure as the password chosen by
the user. As computers get faster and distributed attacks against password fi-
les become more feasible, the list of bad passwords—dictionary words, words
with random capitalization, words with the addition of numbers, words with
numbers replacing letters, reversed words, acronyms, words with the addition
of punctuation—becomes larger. Since authentication and key-exchange pro-
tocols which do not allow passive dictionary attacks against the user’s pas-
sword are possible—Encrypted Key Exchange [BM92,BM94] and its variants
202 B. Schneier, Mudge, and D. Wagner
References