sharplispers / ironclad

A cryptographic toolkit written in Common Lisp
BSD 3-Clause "New" or "Revised" License
176 stars 28 forks source link

bcrypt and bcrypt-pbkdf implementation #34

Closed dnaeon closed 4 years ago

dnaeon commented 4 years ago

Hi,

This is a request for implementing bcrypt hashing and bcrypt-pbkdf.

The reference C implementation for bcrypt-pbkdf can be seen here.

https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bcrypt_pbkdf.c

Thanks!

glv2 commented 4 years ago

I added bcrypt and bcrypt-pbkdf (commits 5834affd7aea86e26fc1b5f2d119007a098d02a8 and b002b740a320ed8d1e415d906bee12f98fd5ed54).

Note that the derive-key method returns the raw hash, not the $2b$[cost]$[22 radix64 character salt][31 radix64 character hash] bcrypt string.

dnaeon commented 4 years ago

Thanks, @glv2 !

dnaeon commented 4 years ago

I've packaged things up in a system for working with bcrypt hashes here, thanks to the newly added code in ironclad.

You can find the system here, if interested.

https://github.com/dnaeon/cl-bcrypt

glv2 commented 4 years ago

Nice!