SHA1 vs MD5

Status
Not open for further replies.

brsy

nah mang
May 12, 2011
1,530
272
Note to Mod: I wasn't sure if this should go in Coders' Paradise as this is considered a debate. Please don't infract me if I am wrong.

There have been a few discussions about wether people should use SHA1 or MD5. I honestly think SHA1 is more secure because it has more characters which would be harder to crack. Although MD5 is very popular so there must be some good behind it. What do you think?
 

HelloSkittle

Member
Jun 3, 2011
59
12
Those reasons are??
''If you were using MD5 someone malicious could generate two messages GOOD and EVIL, give you the good one to look up and later on pretend that you saw the EVIL message.''

Take for example password storage. The trouble with MD5 and SHA1 are that they are really fast, they are designed that way. A fast computer could hash millions of passwords a second.
 

brsy

nah mang
May 12, 2011
1,530
272
''If you were using MD5 someone malicious could generate two messages GOOD and EVIL, give you the good one to look up and later on pretend that you saw the EVIL message.''

Take for example password storage. The trouble with MD5 and SHA1 are that they are really fast, they are designed that way. A fast computer could hash millions of passwords a second.
Wouldn't that be a good thing? You are making your website faster if more passwords can be hashed.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
I'd recommend using for hashing a password.

What is BCrypt? Go to that URL or read these long blocks of text.

Blocks of text:
So to answer your question...
Johannes Gorset said:
Neither. You should use
bcrypt
. The hashes you mention are all optimized to be quick and easy on hardware, and so cracking them share the same qualities. If you have no other choice, at least be sure to use a long salt and re-hash multiple times.
 

HelloSkittle

Member
Jun 3, 2011
59
12
Wouldn't that be a good thing? You are making your website faster if more passwords can be hashed.

Uhm no.
The problem is, that if an attacker gets a dump of the database, he can, quite effectively guess passwords using brute-force. Every combination he tries only takes a fraction of millisecond, and he can try out hundreds of thousands of passwords a second.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
I personally prefer using MD5 because it's what I'm more familiar with. It's quick and doesn't take up much storage in a database -- MD5 ecryptions are ALWAYS 32 characters long, no matter what length of characters you choose to hash.

I may start creating my own salt functions when doing user systems from now on, though.
 

Adil

DevBest CEO
May 28, 2011
1,276
714
MD5 is a fast algorithm that can be cracked like that. Your best bet is a more secure encryption algorithm, such as bCrypt. You could also use RSA and whatnot, and if you were really clever, you could incorporate Euler's totient function (like sulake did), to protect your data.
 
Status
Not open for further replies.

Users who are viewing this thread

Top