Recent from talks
Nothing was collected or created yet.
Challenge-Handshake Authentication Protocol
View on WikipediaIn computing, the Challenge-Handshake Authentication Protocol (CHAP) is an authentication protocol originally used by Point-to-Point Protocol (PPP) to validate users. CHAP is also carried in other authentication protocols such as RADIUS and Diameter.
Almost all network operating systems support PPP with CHAP, as do most network access servers. CHAP is also used in PPPoE, for authenticating DSL users.
As the PPP sends data unencrypted and "in the clear", CHAP is vulnerable to any attacker who can observe the PPP session. An attacker can see the user's name, CHAP challenge, CHAP response, and any other information associated with the PPP session. The attacker can then mount an offline dictionary attack in order to obtain the original password. When used in PPP, CHAP also provides protection against replay attacks by the peer through the use of a challenge which is generated by the authenticator, which is typically a network access server.
Where CHAP is used in other protocols, it may be sent in the clear, or it may be protected by a security layer such as Transport Layer Security (TLS). For example, when CHAP is sent over RADIUS using User Datagram Protocol (UDP), any attacker who can see the RADIUS packets can mount an offline dictionary attack, as with PPP.
CHAP requires that both the client and server know the clear-text version of the password, although the password itself is never sent over the network. Thus when used in PPP, CHAP provides better security as compared to Password Authentication Protocol (PAP) which is vulnerable for both these reasons.
Benefits of CHAP
[edit]When the peer sends CHAP, the authentication server will receive it, and obtain the "known good" password from a database, and perform the CHAP calculations. If the resulting hashes match, then the user is deemed to be authenticated. If the hashes do not match, then the user's authentication attempt is rejected.
Since the authentication server has to store the password in clear-text, it is impossible to use different formats for the stored password. If an attacker were to steal the entire database of passwords, all of those passwords would be visible "in the clear" in the database.
As a result, while CHAP can be more secure than PAP when used over a PPP link, it prevents more secure storage "at rest" than with other methods such as PAP.
Variants
[edit]MS-CHAP is similar to CHAP but uses a different hash algorithm, and allows for each party to authenticate the other.
Working cycle
[edit]CHAP is an authentication scheme originally used by Point-to-Point Protocol (PPP) servers to validate the identity of remote clients. CHAP periodically verifies the identity of the client by using a three-way handshake. This happens at the time of establishing the initial link (LCP), and may happen again at any time afterwards. The verification is based on a shared secret (such as the client's password).[1]
- After the completion of the link establishment phase, the authenticator sends a "challenge" message to the peer.
- The peer responds with a value calculated using a one-way hash function on the challenge and the secret combined.
- The authenticator checks the response against its own calculation of the expected hash value. If the values match, the authenticator acknowledges the authentication; otherwise it should terminate the connection.
- In PPP, the authenticator may send a new challenge at random intervals to the peer and repeats steps 1 through 3. However, when CHAP is used in most situations (e.g. RADIUS), this step is not performed.
CHAP packets
[edit]| Description | 1 byte | 1 byte | 2 bytes | 1 byte | Variable | Variable |
|---|---|---|---|---|---|---|
| Challenge | Code = 1 | ID | Length | Challenge length | Challenge value | Name |
| Response | Code = 2 | ID | Length | Response length | Response value | Name |
| Success | Code = 3 | ID | Length | Message | ||
| Failure | Code = 4 | ID | Length | Message |
The ID chosen for the random challenge is also used in the corresponding response, success, and failure packets. A new challenge with a new ID must be different from the last challenge with another ID. If the success or failure is lost, the same response can be sent again, and it triggers the same success or failure indication. For MD5 as hash the response value is MD5(ID||secret||challenge), the MD5 for the concatenation of ID, secret, and challenge.[2]
See also
[edit]References
[edit]- ^ Forouzan (2007). Data Communications & Networking 4E Sie. McGraw-Hill Education (India) Pvt Limited. pp. 352–. ISBN 978-0-07-063414-5. Retrieved 24 November 2012.
- ^ "Understanding and Configuring PPP CHAP Authentication". Cisco tech note. 2005. Retrieved 2011-08-14.
External links
[edit]Challenge-Handshake Authentication Protocol
View on GrokipediaIntroduction
Definition and Purpose
The Challenge-Handshake Authentication Protocol (CHAP) is a challenge-response authentication protocol designed for use within the Point-to-Point Protocol (PPP) framework to securely verify the identity of communicating peers. It operates as part of PPP's optional Authentication phase, which is negotiated during the link establishment process to enable multi-protocol datagram transport over point-to-point links.[5] CHAP employs a three-way handshake mechanism to authenticate peers without requiring the transmission of plaintext passwords or credentials over the network, thereby enhancing security in environments such as dial-up connections and other PPP-based network setups.[5] The primary purpose of CHAP is to confirm the legitimacy of a peer's identity both at the initial establishment of a PPP link and at periodic intervals thereafter, mitigating risks of unauthorized access and session hijacking. By challenging the peer with a unique value and expecting a response derived from a shared secret, CHAP ensures that only entities possessing the correct secret can successfully authenticate, without exposing sensitive information to interception.[5] This approach was developed specifically for PPP to supplant less secure authentication methods like the Password Authentication Protocol (PAP), providing a more robust alternative for one-way or mutual authentication in insecure transmission media.[5] At its core, CHAP involves an authenticator (typically the access server) generating and sending a random challenge to the peer, which then computes a cryptographic response using the challenge, an identifier, and a pre-shared secret known only to both parties. The authenticator verifies this response against its own computation of the expected value, completing the handshake without the secret ever traversing the link. This key component structure supports ongoing re-authentication at irregular intervals post-link establishment, maintaining session integrity over time.[5]Historical Development
The Challenge-Handshake Authentication Protocol (CHAP) emerged in the early 1990s as an enhancement to the Point-to-Point Protocol (PPP), addressing the growing need for secure authentication in dial-up internet services and point-to-point serial links. PPP itself was initially proposed in RFC 1134 in November 1989 by Drew Perkins, which outlined a framework for multi-protocol datagram transmission but reserved space for authentication mechanisms without specifying details.[6] As internet connectivity expanded through modems and leased lines, the demand for robust peer verification prompted the development of authentication options within PPP's Link Control Protocol phase.[7] Key milestones in CHAP's specification occurred through Internet Engineering Task Force (IETF) documents. In October 1992, RFC 1334 introduced CHAP alongside the Password Authentication Protocol (PAP) as optional PPP authentication protocols, describing a basic three-way handshake to verify peer identity using hashed responses to random challenges, thereby improving upon the simpler, less secure methods in early PPP drafts.[8] This was further refined and formalized in August 1996 with RFC 1994, which obsoleted the authentication details in RFC 1334 and provided a comprehensive definition of CHAP's mechanics, including its use of MD5 hashing for response generation and support for periodic re-authentication.[9] These specifications established CHAP as a standard for PPP links, emphasizing protection against replay attacks in environments like switched circuits. CHAP was developed under the auspices of the IETF's Point-to-Point Protocol Extensions (pppext) Working Group, which focused on extending PPP capabilities to meet evolving networking requirements in the post-SLIP era.[10] By the mid-1990s, CHAP saw widespread implementation in modems, routers, and network access servers to secure remote connections, particularly for Internet Service Provider (ISP) dial-up services. Its integration into major operating systems, including Windows NT and various Unix variants, accelerated by the late 1990s, making it a de facto standard for PPP-based authentication in enterprise and consumer networking equipment.[9]Protocol Mechanism
Challenge-Response Process
The Challenge-Handshake Authentication Protocol (CHAP) operates through a core challenge-response mechanism that verifies the identity of the peer without transmitting the shared secret over the link. Upon successful link establishment, the authenticator generates a random challenge value and a unique identifier, and transmits this challenge packet to the peer.[5] The peer then computes a response by applying the MD5 one-way hash function to the concatenation of the received identifier, the shared secret known only to both parties, and the challenge value. This hashed response is sent back to the authenticator in a response packet, which also includes the peer's name for identification. The authenticator independently recomputes the expected hash using the same inputs—identifier, shared secret, and challenge value—and compares it to the peer's response; a match confirms successful authentication, while a mismatch indicates failure.[5] To enhance security, the identifier is a value that changes with each new challenge, ensuring that responses from previous exchanges cannot be replayed, as the authenticator rejects any response with an mismatched identifier.[5] CHAP is designed primarily for one-way authentication, where the peer proves its identity to the authenticator, but mutual authentication can be configured by negotiating the protocol in both directions using the same shared secret.[5] In case of authentication failure, the authenticator sends a failure packet, which typically terminates the link or prompts renegotiation via the Link Control Protocol (LCP), without allowing retries within the same exchange. Successful authentication, conversely, allows the connection to proceed to the network-layer protocol phase, establishing the full PPP session.[5] This initial challenge-response exchange may be repeated periodically during the session to re-verify the peer's identity.[5]Authentication Cycle
The Challenge-Handshake Authentication Protocol (CHAP) operates within the Point-to-Point Protocol (PPP) framework as an iterative process that verifies the peer's identity throughout the connection lifecycle. Following the completion of the Link Establishment phase via the Link Control Protocol (LCP), the authenticator initiates the cycle by sending an initial challenge message to the peer.[9] The peer then computes and responds with a value derived from the challenge and a shared secret, after which the authenticator validates the response and issues either a Success or Failure message.[9] Upon success, the connection proceeds to the Network-Layer Protocol phase, such as IP Control Protocol (IPCP) negotiation; a failure, however, terminates the link without retry attempts, preventing further protocol negotiations.[9] To maintain security without interrupting ongoing data transmission, CHAP incorporates periodic re-authentication as part of its ongoing cycle. The authenticator generates additional challenges at random intervals during the established connection, prompting the peer to respond similarly to the initial exchange.[9] These re-authentication events occur whenever the authenticator desires, ensuring continuous verification while preserving the flow of network-layer protocols.[9] The protocol's design allows this repetition indefinitely, as long as the link remains active, fostering a dynamic authentication environment integrated seamlessly into PPP's layered structure.[9] The authentication cycle concludes upon link termination, which occurs either through an explicit LCP Terminate-Request/Acknowledge sequence or an abrupt link drop.[9] In such cases, no further challenges are issued, and the connection is fully dismantled, with the option for LCP to renegotiate a new session if needed.[9] This lifecycle emphasizes CHAP's role in providing ongoing, non-disruptive identity assurance within PPP links.[9]Technical Details
Packet Structure
The Challenge-Handshake Authentication Protocol (CHAP) packets are encapsulated within Point-to-Point Protocol (PPP) Data Link Layer frames, using the protocol field value of 0xC223.[5] This encapsulation ensures CHAP operates as part of the PPP negotiation process.[11] All CHAP packets share a common header structure consisting of three fixed fields, followed by variable data specific to the packet type. The header begins with the Code field, a single octet (1 byte) that identifies the packet type: 1 for Challenge, 2 for Response, 3 for Success, and 4 for Failure.[5] Next is the Identifier field, also 1 octet, which serves to match a Challenge packet with its corresponding Response and reply; it is typically a sequence number incremented for each new challenge.[5] The header concludes with the Length field, 2 octets in network byte order, specifying the total length of the entire packet, including the header and all data fields, to allow for variable-sized payloads.[5] For Challenge (Code 1) and Response (Code 2) packets, the data portion follows a structured format starting with the Value-Size field (1 octet), which indicates the length of the subsequent Value field. The Value field is variable-length: in a Challenge packet, it contains a stream of pseudo-random bytes (minimum 1 octet, but at least 16 octets recommended, configurable up to the maximum packet size) generated by the authenticator to ensure uniqueness and prevent replay attacks.[5] In a Response packet, the Value field is fixed at 16 octets, comprising the MD5 hash of the Identifier, shared secret, and Challenge Value.[5] Both packet types end with the Name field, a variable-length ASCII string (up to 255 octets) identifying the sending system, such as the peer's hostname or username.[5] Success (Code 3) and Failure (Code 4) packets have a simpler data structure, lacking Value-Size and Value fields. Instead, they include a Message field of variable octets (up to the Length minus 4), containing a human-readable ASCII string (not null-terminated) for diagnostic or status information; for Success, this might confirm authentication, while for Failure, it could indicate the reason for denial, though the exact content is implementation-dependent.[5] The following table illustrates the byte-level layout for each packet type, assuming minimum sizes for clarity:| Field | Challenge (Code 1) | Response (Code 2) | Success (Code 3) | Failure (Code 4) |
|---|---|---|---|---|
| Code | 1 octet (1) | 1 octet (2) | 1 octet (3) | 1 octet (4) |
| Identifier | 1 octet | 1 octet | 1 octet | 1 octet |
| Length | 2 octets | 2 octets | 2 octets | 2 octets |
| Value-Size | 1 octet | 1 octet | - | - |
| Value | Variable (min. 1 octet, recommended ≥16 random) | 16 octets (MD5 hash) | - | - |
| Name / Message | Variable (peer ID) | Variable (peer ID) | Variable (message) | Variable (message) |
