1

I want to use crypt() CRYPT_BLOWFISH hashing. Since PHP version is 5.2.14, CRYPT_BLOWFISH is 0.

So, I install CRYPT_BLOWFISH using the following command: pear install Crypt_Blowfish-1.1.0RC2

It shows Crypt_Blowfish-1.1.0RC2 is installed. However, echo CRYPT_BLOWFISH is still 0. How can I use CRYPT_BLOWFISH hashing if I do not upgrade my PHP version?

chnet
  • 1,993
  • 9
  • 36
  • 51

1 Answers1

3

PEAR modules don't add features to stock PHP, so it isn't going to affect constants like CRYPT_BLOWFISH, nor can you use the standard functions. You'll need to use the equivalents from the Crypt_Blowfish package.

There's a usage example on the PEAR docs for Crypt_Blowfish.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • Right. I check the example. It initializes a Crypt_Blowfish instance. What I want is to make PHP crypt() use Crypt_Blowfish hashing. As the manual said, I just need to craft a salt as '$2a2$', then crypt() will use Crypt_Blowfish hashing. But pear gives me a Crypt_Blowfish instance, how can I use it in crypt()? – chnet Jul 27 '11 at 15:46
  • You won't be able to use the native `crypt()` call. You will need to use the PEAR package's functions instead. The `crypt()` function doesn't have any way of knowing about the `Crypt_Blowfish` package. – ceejayoz Jul 27 '11 at 15:48
  • Another question I have is that I activate suhosin simulation mode. It will violations. So where is the logging? – chnet Aug 01 '11 at 21:30