CHAP: A Password Can Stay Hidden and Still Be Guessed
CHAP can check a password without sending the password across the connection. Someone who records the exchange can still try to guess the secret afterward.
CHAP stands for Challenge-Handshake Authentication Protocol. It's an older method of authentication: checking that the other end of a connection knows an agreed secret.
It was designed for Point-to-Point Protocol, or PPP, which carries data between two ends of a link. Dial-up connections and links between network routers are part of that history.
Answer a fresh question
CHAP's basic exchange has three messages: a challenge, a response, and a result. The two ends must already share a secret before this conversation begins.
The authenticator, the end doing the checking, sends a fresh challenge value. The peer, the end being checked, uses that challenge, a small identifier for the exchange, and the shared secret to calculate an answer.
That calculation uses a hash function, a mathematical operation that produces a fixed-length result from its input. Classic CHAP uses a hash called MD5; it doesn't encrypt the challenge for the other side to decrypt.
The authenticator calculates the expected answer using its own copy of the secret, compares the results, and sends success or failure. Cisco's explanation of CHAP walks through this exchange between two routers.
PAP and CHAP: Two Ways to Send a Password
One exchange checks one direction. If both ends need to verify each other, they can run separate CHAP exchanges in opposite directions.
Why changing the challenge matters
A recorded answer shouldn't work forever. By changing the challenge, CHAP makes yesterday's response the wrong answer to today's question.
That helps defend against a replay attack, where someone tries to reuse a captured message to pass a check. The CHAP specification calls for unique, unpredictable challenges and allows fresh checks after the connection has been established.
There's a price for this design: the checking system needs access to the actual shared secret to calculate an answer. It can't perform ordinary CHAP verification using only the irreversible password hash that many login systems store.
The secret can be encrypted while stored, but it must be recoverable for the check. Protecting the systems and configuration files that hold it therefore matters as much as keeping it out of the exchange.
- Make a stolen password useless without the key in your hand.
- Sign in with a tap instead of typing a code.
- Protect Google, Microsoft, Apple and more than 1,000 other accounts.
A hidden password can still be guessed
Consider an attacker who captures a challenge and its response. They can calculate what the response would have been for a guessed password and compare their result with the recorded answer.
This is offline guessing: the attacker tests guesses on their own machine instead of submitting each one to the login service. A service's lockout rule can't count attempts it never receives.
That's a consequence of how the response is calculated, and it makes a predictable shared password a serious weakness. Fresh challenges prevent simple reuse of old answers; they don't make a weak secret hard to guess.
The related EAP-MD5 method, used within a framework for carrying authentication exchanges, has the same general challenge-and-response approach. Its specification explicitly lists no protection against dictionary attacks, which test likely passwords from a prepared list.
Three names that shouldn't blur together
PAP, the Password Authentication Protocol, sends a password in readable form within its own exchange. Its specification describes that weakness; a separate encrypted connection could protect the exchange, but PAP itself doesn't.
CHAP avoids sending the secret itself, with the limits described above. MS-CHAPv2 is a different Microsoft variant with different calculations and a built-in two-way check, as its own specification explains.
Don't assume advice or a security claim about one applies unchanged to the others.
Also, passing CHAP doesn't encrypt the data that follows: authentication checks a claim to identity, while encryption protects content from being read. If a connection offers CHAP, you still need to establish what protects its traffic and whether the complete setup meets your security needs.
PAP: The Password Request and the Protection Around It

Point-to-Point Protocol: How PPP Sets Up a Connection

Dictionary Attacks: Why Familiar Password Tricks Fail

QUOTE:
"Amateurs hack systems, professionals hack people."
