| | |
Blowfish Hashing?!?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2008
Posts: 250
Reputation:
Solved Threads: 20
Hi,
On my websites, I encrypt passwords using a combination of hashing algorithm (Which I am obviously not going to post on a forum but its along the lines of
What is blowfish, how do I use it and how much more secure is it than a function as shown above?
Regards,
Sam Rudge
On my websites, I encrypt passwords using a combination of hashing algorithm (Which I am obviously not going to post on a forum but its along the lines of
md5(substr(whirlpool($Value), 0, 7)); )What is blowfish, how do I use it and how much more secure is it than a function as shown above?
Regards,
Sam Rudge
Last edited by samarudge; 31 Days Ago at 9:52 pm.
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
0
#2 31 Days Ago
Hey.
I was under the impression that Blowfish was an encryption cipher, not a hashing algorithm?
Encryption usually allows for decryption, while hashing does not, and I believe Blowfish does allow for decryption. (Although, now that I think about it, I am not entirely sure on that point.)
In any case, the answer to the question of "how much more secure is it" won't have a simple and undisputed answer, as this is a very complex topic.
Lets just say that for the foreseeable future, you will be pretty safe with either Blowfish or a couple of iterations of a salted hashing algorithm, given that you aren't still using MD5 or SHA1 :-]
I was under the impression that Blowfish was an encryption cipher, not a hashing algorithm?
Encryption usually allows for decryption, while hashing does not, and I believe Blowfish does allow for decryption. (Although, now that I think about it, I am not entirely sure on that point.)
In any case, the answer to the question of "how much more secure is it" won't have a simple and undisputed answer, as this is a very complex topic.
Lets just say that for the foreseeable future, you will be pretty safe with either Blowfish or a couple of iterations of a salted hashing algorithm, given that you aren't still using MD5 or SHA1 :-]
Last edited by Atli; 31 Days Ago at 10:57 pm.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
1
#3 31 Days Ago
As Atli says, Blowfish is an encryption cipher, not a hashing algorithm.
It is in the mcrypt library (http://php.net/manual/en/book.mcrypt.php)
There was a whole thread a while back discussing passwords and some good methods. I'll see if I can find it...
EDIT:
Thread is here:
http://www.daniweb.com/forums/thread178241.html
It is in the mcrypt library (http://php.net/manual/en/book.mcrypt.php)
There was a whole thread a while back discussing passwords and some good methods. I'll see if I can find it...
EDIT:
Thread is here:
http://www.daniweb.com/forums/thread178241.html
Last edited by Will Gresham; 31 Days Ago at 11:07 pm.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: May 2008
Posts: 250
Reputation:
Solved Threads: 20
0
#4 31 Days Ago
OK thanx, I think I will stick with my current method of lots of salts (In the actual function I use about 5 different algorithms)
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
0
#5 31 Days Ago
•
•
•
•
Hi,
On my websites, I encrypt passwords using a combination of hashing algorithm (Which I am obviously not going to post on a forum but its along the lines ofmd5(substr(whirlpool($Value), 0, 7));)
What is blowfish, how do I use it and how much more secure is it than a function as shown above?
Regards,
Sam Rudge
Taking a substr() of 7 characters makes it very insecure. You've effectively made the password a 7 character string composed of 0-9 and a-f. (hexadecimal).
This makes guessing the password less then 16^7 possibilities, which is very insecure. A single machine would guess it in less then an hour. A rainbow table, a few seconds.
I've updated the linked thread with a few tips:
http://www.daniweb.com/forums/thread178241.html
You can actually use blowfish, enough though it is a cypher. Part of its algorithm is used in BCrypt (http://www.usenix.org/events/usenix9...tml/node1.html) which is the password hashing function in OpenBSD.
The reason is that blowfish uses 4Kb of RAM when processing keys. Thus you can make it process a large number of keys, in order to make sure your algorithm uses a large amount of ram.
Say you want to use 1MB for each hashing function. You could generate 1000/4 keys, and feed them into blowfish then rehash. Note this isn't to encrypt the password, you just want to take up 1MB of RAM, so that anyone trying a brute force attack on the hashes requires 1MB for each hash which is unfeasible for them.
You however, can afford 1MB since logins are not a bottleneck on web applications. Things like disk and network IO usually are.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Other Threads in the PHP Forum
- Previous Thread: Error: Commands out of sync; you can't run this command now
- Next Thread: Search string is too exact help
| Thread Tools | Search this Thread |
apache api array back basic beginner binary broken cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php problem query question radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web xml youtube






