Bcrypt

bcrypt 파일 암호화 유틸리티에 대해서는 블로피시 문서를 참고하십시오.

bcrypt
일반
설계자Niels Provos, David Mazières
최초 출판일1999
기원블로피시
상세 정보
다이제스트 크기184비트
라운드 수비용 변수에 따라 가변적

bcrypt는 블로피시 암호에 기반을 둔 암호화 해시 함수로서 Niels Provos와 David Mazières가 설계하였으며 1999년 USENIX에서 발표되었다. 레인보 테이블 공격 방지를 위해 솔트를 통합한 bcrypt는 적응형 함수의 하나이다. 시간이 지남에 따라 속도 저하를 위해 반복 횟수가 증가가 수반될 수 있으므로 연산 파워의 증가에도 브루트 포스 검색 공격에 대한 저항을 유지하게 된다.

bcrypt 함수는 OpenBSD 및 수세 리눅스 등의 일부 리눅스 배포판을 포함한 기타 시스템용 기본 암호 해시 함수이다.

C, C++, C#, Elixir, Go, Java, 자바스크립트, 펄, PHP, 파이썬, Ruby 등의 언어용으로 bcrypt 구현체가 존재한다.

개요

bcrypt 해시 문자열은 다음의 형태에 속한다:

$2b$[cost]$[22 character salt][31 character hash]

예:

$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy
 \/ \/ \____________________/\_____________________________/
Alg Cost       Salt                        Hash

여기서

알고리즘

Function bcrypt
   Input:
      cost:     Number (4..31)                      log2(Iterations). e.g. 12 ==> 212 = 4,096 iterations
      salt:     array of Bytes (16 bytes)           random salt
      password: array of Bytes (1..72 bytes)        UTF-8 encoded password
   Output:
      hash:     array of Bytes (24 bytes)
   //Initialize Blowfish state with expensive key setup algorithm
   //P: array of 18 subkeys (UInt32[18])
   //S: Four substitution boxes (S-boxes), S0...S3. Each S-box is 1,024 bytes (UInt32[256])
   P, S ← EksBlowfishSetup(cost, salt, password)
   //Repeatedly encrypt the text "OrpheanBeholderScryDoubt" 64 times
   ctext ← "OrpheanBeholderScryDoubt"  //24 bytes ==> three 64-bit blocks
   repeat (64)
      ctext ← EncryptECB(P, S, ctext) //encrypt using standard Blowfish in ECB mode
   //24-byte ctext is resulting password hash
   return Concatenate(cost, salt, ctext)

같이 보기