php - Mimic CRYPT_BLOWFISH with MCRYPT_BLOWFISH -


my question how same result mcrypt crypt, respect blowfish?

i wanting use the phpass framework password hashing , verifying. works long has have php 5.3 because blowfish included crypt(). host running php 5.2.x mcrypt library.

going through docs , googling blowfish crypt, appears result '$a2$', 2 character iteration value, '$', salt ( padded or cut 22 characters ), 32 base64 string representing hash.

my problem can't find explanations of mcrypt_mode_modenames make sense me. , how feed mcrypt() number of iterations want? or 2 functions using different forms of blowfish dont cross translate?

mcrypt, , crypt() 2 totally different functions. mcrypt two-way encryption, whereas crypt one-way encryption. far aware crypt() inside of php 5.2. also, if i'd reference crypt() itself. , i'd use bcrypt it.

 $hashed_password=crypt($password_to_be_hashed,'$2a$04$saltstringhere'); 

finally, change 2 digit cost factor inside of 2 digits after $2a$. allow change amount of cputime going required it. remember goes logarithmically(if remember correctly). default value 07.

finally crypt_blowfish two-way encryption algorithm of blowfish takes keys 448 bits. blowfish inside of crypt bcrypt, based upon blowfish designed storing passwords hashes them. known one-way encryption.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -