Skip to content

Digest access authentication

Digest access authentication is one of the agreed-upon methods a web server can use to negotiate credentials, such as username or password, with a user's web browser. This can be used to confirm the identity of a user before sending sensitive information, such as online banking transaction history. It applies a hash function to the username and password before sending them over the network. In contrast, basic access authentication uses the easily reversible Base64 encoding instead of encryption, making it non-secure unless used in conjunction with TLS.

Technically, digest authentication is an application of MD5 cryptographic hashing with usage of nonce values to prevent replay attacks. It uses the HTTP protocol.

About

  • HTTP에서 작동하는 인증 방식 중 하나
  • 사용자명, 패스워드 등을 조합하여 MD5 값으로 인증
  • 기본 인증보다 보안이 강화된 인증

작동방식

  1. (클라이언트 → 서버) 페이지 요청
  2. (서버 → 클라이언트) Digest 인증 필요하다고 통보
  3. (클라이언트 → 서버) 사용자가 아이디/패스워드 입력하면, 서버 정보+클라이언트 정보를 병합하고 MD5암호화하여 보냄

즉 Digest 인증방식에서 서버는 클라이언트로부터 단순히 패스워드를 받는 것이 아니다. 아래처럼 여러가지가 조합되고 MD5로 해시된 값(Response)을 받는다.

HA1 = MD5( "사용자명:영역명:패스워드" )
HA2 = MD5( "HTTP요청방식:URI주소" )
Response = MD5( "HA1값:서버NONCE:요청카운터:클라이언트NONCE:보호품질코드:HA2값" )

서버에서 인증(로그인)을 해주려면, 알고 있는 값들을 가지고 같은 방식으로 유효한 Response값을 만든 후, 클라이언트가 보내온 Response가 그와 같은지 비교해야 한다.

See also

Favorite site

References


  1. Feel5ny.github.io_-20191124-HTTP_013_01-_Digest_access_authentication.pdf