Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

CRAM-MD5

From Wikipedia, the free encyclopedia
Network protocol

Incryptography,CRAM-MD5 is achallenge–response authentication mechanism (CRAM) based on theHMAC-MD5 algorithm. As one of the mechanisms supported by theSimple Authentication and Security Layer (SASL), it is often used in email software as part ofSMTP Authentication and for the authentication ofPOP andIMAP users, as well as in applications implementingLDAP,XMPP,BEEP, and other protocols.

When such software requires authentication over unencrypted connections, CRAM-MD5 is preferred over mechanisms that transmit passwords "in the clear," such asLOGIN andPLAIN. However, it can't prevent derivation of a password through abrute-force attack, so it is less effective than alternative mechanisms that avoid passwords or that use connections encrypted withTransport Layer Security (TLS).

Protocol

[edit]

The CRAM-MD5 protocol involves a single challenge and response cycle, and is initiated by the server:

  1. Challenge: The server sends abase64-encoded string to the client. Before encoding, it could be any random string, but the standard that currently defines CRAM-MD5 says that it is in the format of aMessage-ID email header value (includingangle brackets) and includes an arbitrary string of random digits, atimestamp, and the server'sfully qualified domain name.
  2. Response: The client responds with a string created as follows.
    1. The challenge is base64-decoded.
    2. The decoded challenge is hashed usingHMAC-MD5, with ashared secret (typically, the user's password, or a hash thereof) as the secret key.
    3. The hashed challenge is converted to a string of lowercase hex digits.
    4. Theusername and a space character are prepended to the hex digits.
    5. The concatenation is then base64-encoded and sent to the server
  3. Comparison: The server uses the same method to compute the expected response. If the given response and the expected response match, then authentication was successful.

Strengths

[edit]

The one-way hash and the fresh random challenge provide three types of security:

  • Others cannot duplicate the hash without knowing the password. This provides authentication.
  • Others cannot replay the hash—it is dependent on the unpredictable challenge. This is variously called freshness orreplay prevention.
  • Observers do not learn the password; this is called secrecy.

Weaknesses

[edit]
  • Weak password storage: some implementations require access to the users' plain text passwords, while others (e.g.Dovecot) use the intermediate step of the HMAC process to store theMD5-hash of the password (strictly speaking of HMAC's internal variables i_key_pad and o_key_pad).[1][2] Such implementations leverage that for computing md5(something_with_64_bytes || something_else), only md5_internal(something_with_64_bytes) and something_else are needed to know (because of Merkle–Damgård usage in MD5; md5_internal is md5 without the final block). As i_key_pad and o_key_pad are at the start of the inner and outer hash of HMAC, and have a length of 64 bytes, this fact can be used.[citation needed]
  • Threat of reversibility: an offlinedictionary attack to recover the password is feasible after capturing a successful CRAM-MD5 protocol exchange (e.g., usingCain & Abel). This threat is unavoidable in any password hashing scheme, but more modern algorithms usekey stretching for increasing the cost of an attack by a factor of one thousand or more. Conversely, CRAM-MD5 digests can be calculated using very few computational resources on dedicated hardware, or even just standardCPUs.[citation needed]
  • Proxy-ability: Unlike apassword-authenticated key agreement (PAKE) scheme, CRAM-MD5 does not establish a secret shared between the two endpoints but unknown to an eavesdropper. An activeman in the middle can therefore open a connection to the server, get a challenge, offer that challenge to the client, receive the client's response, and forward that response to the server. It can now drop the client's further messages while impersonating the client to the server.[citation needed]

Standards

[edit]

CRAM-MD5 is defined by theIETF standards-track document RFC 2195, which supersedes RFC 2095, from earlier in 1997. Thesede facto standards define CRAM-MD5 as an authentication method for the email mailbox-management protocolsPOP andIMAP.

CRAM-MD5 is one of the authentication methods supported bySimple Authentication and Security Layer (SASL), defined in 2006 by RFC 4422, which supersedes the 1997 standard RFC 2222.

TheInternet Assigned Numbers Authority (IANA) maintains a registry of SASL mechanisms,[3] including CRAM-MD5, for limited use.

CRAM-MD5 is required forOn-Demand Mail Relay (ODMR), defined in RFC 2645.

Obsolete

[edit]

It was recommended to deprecate the standard in 20 November 2008. As an alternative it recommends e.g.SCRAM orSASL Plain protected byTLS instead.[4]

See also

[edit]

References

[edit]
  1. ^"function verify_credentials".Dovecot 2.0 source. Retrieved23 January 2014.
  2. ^"file hmac-md5.c".Dovecot 2.0 source. Retrieved23 January 2014.
  3. ^"Simple Authentication and Security Layer (SASL) Mechanisms".Protocol Registries.IANA.
  4. ^Zeilenga, Kurt (24 November 2008)."CRAM-MD5 to Historic".tools.ietf.org. Retrieved2020-12-05.
Authentication
APIs
Authentication
protocols
Retrieved from "https://en.wikipedia.org/w/index.php?title=CRAM-MD5&oldid=1312674253"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp