I want to use bcrypt in php (before php 5.3), and to do that I need to get crypt installed appropriately on my debian server.

On ubuntu, I have crypt installed, but on debian it's not there:

man crypt 
No manual entry for crypt

Debian version info:

cat /proc/version
cat /etc/issue
uname -a
Linux version 2.6.35.4-rscloud (root@builder.slicehost.com) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #8 SMP Mon Sep 20 15:54:33 UTC 2010
Debian GNU/Linux 5.0 \n \l
Linux Sherman 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux

Using: apt-cache search crypt

Yeilds tons of results that are partial matches, but no crypt per se.

So is there any way to install crypt with blowfish/bcrypt on Debian 5.0, and if so, what's the easiest method?

link|improve this question

55% accept rate
1  
You mention you have 'crypt' installed on your Ubuntu system. What is the installed package name there? AFAIK there is no standard package from Ubuntu that goes by the name of crypt. Perhaps you need to run dpkg --get-selections on your Ubuntu system and see the exact names of the packages installed? – Zoredache Aug 4 '11 at 22:44
@Zoredache Hard to tell, the installed packages with the phrase crypt in them are: libcryptui0 install libgcrypt11 install libk5crypto3 install python-crypto install erlang-crypto install – Tchalvak Aug 5 '11 at 15:49
feedback

2 Answers

On Debian PHP is compiled with a dependency for libgcrypt11-dev which includes many important free ciphers, hash algorithms and public key signing algorithms including: arcfour, blowfish, cast5, DSA, and so on.

Perhaps you are looking to install the php5-mcrypt package? Blowfish is one of the ciphers available.

link|improve this answer
Hmmm, mcrypt is already installed, and libgcrypt11-dev wasn't installed, but I'm not really sure how to deal with it post install to make it take positive effect. – Tchalvak Aug 5 '11 at 15:46
My test case is: if (CRYPT_BLOWFISH == 1) { echo 'Blowfish: ' . crypt('rasmuslerdorf', '$2a$07$usesomesillystringforsalt$') . "<br>\n"; } – Tchalvak Aug 5 '11 at 15:50
feedback

Ended up having to go the upgrade route from php 5.2 to php 5.3 to enable blowfish crypt support.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.