일반 | |
---|---|
설계자 | Niels Provos, David Mazières |
최초 출판일 | 1999 |
기원 | 블로피시 |
상세 정보 | |
다이제스트 크기 | 184비트 |
라운드 수 | 비용 변수에 따라 가변적 |
bcrypt는블로피시 암호에 기반을 둔암호화 해시 함수로서Niels Provos와 David Mazières가 설계하였으며 1999년USENIX에서 발표되었다.[1]레인보 테이블 공격 방지를 위해솔트를 통합한 bcrypt는 적응형 함수의 하나이다. 시간이 지남에 따라 속도 저하를 위해 반복 횟수가 증가가 수반될 수 있으므로 연산 파워의 증가에도브루트 포스 검색 공격에 대한 저항을 유지하게 된다.
bcrypt 함수는OpenBSD[2] 및수세 리눅스 등의 일부리눅스 배포판을 포함한 기타 시스템용 기본 암호해시 함수이다.[3]
C,C++,C#,Elixir,[4]Go,[5]Java,[6][7]자바스크립트,[8]펄,PHP,파이썬,[9]Ruby 등의 언어용으로 bcrypt 구현체가 존재한다.
bcrypt 해시 문자열은 다음의 형태에 속한다:
$2b$[cost]$[22 character salt][31 character hash]
예:
$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy \/ \/ \____________________/\_____________________________/Alg Cost Salt Hash
여기서
2a
: 해시 알고리즘 식별자 (bcrypt)10
: Cost factor (210
==> 1,024 rounds)N9qo8uLOickgx2ZMRZoMye
: 16바이트(128비트) 솔트, base64-encoded to 22 charactersIjZAgcfl7p92ldGxad68LJZdL17lhWy
: 24바이트(192비트) 해시, base64-encoded to 31 charactersFunction bcryptInput: 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 passwordOutput: 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 timesctext ←"OrpheanBeholderScryDoubt"//24 bytes ==> three 64-bit blocksrepeat (64)ctext ← EncryptECB(P,S,ctext)//encrypt using standard Blowfish in ECB mode
//24-bytectext is resulting password hashreturn Concatenate(cost,salt,ctext)
SUSE's crypt() implementation supports the blowfish password hashing function (id $2a) and system logins by default also use this method.