Challenge Handshake Authentication Protocol (CHAP)

The Challenge Handshake Authentication Protocol (CHAP) is significantly more secure than PAP.
This is because of the mechanism used to transfer the username and password: CHAP protects
against playback hacking (resending the packet as part of an attack) by using a hash value that is
valid only for that transaction. When the attacker captures the CHAP session and replays that dialog
in an attempt to access the network, the hash method will prevent the connection. The password is
also hidden from the attacker; it is never sent over the circuit.
The hash value used in CHAP is derived from the Message Digest type 5 (MD5) algorithm,
which takes a message of arbitrary length and produces as output a 128-bit message digest of
the input. The message digest’s strength comes from being nonreversible, and it is computationally
infeasible to produce two messages having the same message digest. The MD5 algorithm is
defined in RFC 1321.
The MD5 hash shown in Figure 24.8 is valid for a relatively brief time, and no unencrypted information
is sent over the link. This data might allow a hacker to impersonate the authentic user.
FIGURE 2 4 . 8 CHAP authentication
The commands to configure CHAP are similar to those for PAP. Instead of selecting pap in the
ppp authentication command, the administrator uses the chap keyword. Notice, from the following
configuration snippet, that two additional options are also available: chap pap and pap
chap. These keywords provide the administrator with a means of selecting both protocols, and they
are attempted in order; thus, chap pap tries to authenticate via the CHAP protocol first. Typically,
this configuration option is used only during a transition because security would be compromised
if PAP were permitted. The following commands are used to enable PPP, a requirement for CHAP,
and to configure the router for CHAP authentication:
encapsulation ppp
ppp authentication {chap | chap pap | pap chap |
pap} [if-needed] [list-name | default] [callin]
The additional commands that you see are used for external user authentication and one-way
authentication. These are beyond the scope of this book, but they are included for completeness.
Usernames and passwords are added to the router with the username name password
secret command.
In Windows networking, the administrator is given the choice of whether to require password
encryption, as shown in Figure 24.9. Note that this Require Encrypted Password check box is not
selected, meaning that the user or administrator has chosen not to require encrypted passwords.

This configuration will work so long as PAP is not the only selected authentication method
on the access server. The Windows client will attempt to connect with MS-CHAP, a Microsoft
proprietary version of the CHAP protocol. If the check box is selected—meaning the password
must be encrypted—either PAP or CHAP will be used, depending on the configuration
of the server; if the server is not set to require CHAP, the client can fall back to a PAP, nonencrypted
password.