4

A number of scripting languages (Python/PHP/etc...) include functionality (sometimes through extensions) that allows you to use Blowfish as a one way hash on passwords. I'm trying to find a similar implementation for C++ but everything I've come across is an encryption/decryption solution.

Can somebody recommend a library for C++ that provides the same functionality?

Endophage
  • 21,038
  • 13
  • 59
  • 90
  • 1
    Maybe you should start over. Blowfish is a symmetric cipher; how do you imagine it relates to hashing? – Kerrek SB Oct 12 '11 at 00:34
  • @Kerrek Please take the entire post into account... see the first answer for some info on use in scripting languages as a hashing algo http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php – Endophage Oct 12 '11 at 00:40
  • @KerrekSB, it is very common to use a symmetric cipher as part of a cryptographic hash: [OpenBSD allows using blowfish for password hashing](http://www.openbsd.org/cgi-bin/man.cgi?query=crypt&sektion=3&arch=&apropos=0&manpath=OpenBSD+Current), [`pam_unix` provides a blowfish option](http://manpages.ubuntu.com/manpages/maverick/man8/pam_unix.8.html). `crypt(3)` uses a modified DES as part of the password hashing mechanism. (It was modified so existing off-the-shelf DES crackers couldn't be used to brute-force passwords. Seems quaint in retrospect.) – sarnold Oct 12 '11 at 00:45

1 Answers1

6

There's a java version at jbcrypt. There's a paper on bcrypt at openbsd.org and microsoft. You can find the source for bcrypt at http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/crypt/ and more info at http://www.openwall.com/crypt/

Eugene
  • 10,957
  • 20
  • 69
  • 97