Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It`s possible to break a sha1(md5('password')) password?

This is the question: It`s possible to break a sha1(md5('password')) password ?

Or how it`s better md5 in sha1 or sha1 in md5 ?

Thanks!

like image 718
Csabi Avatar asked Apr 23 '11 16:04

Csabi


3 Answers

multiple hashing doesnt further secure your password. just use a secure, salted hash.

check out http://php.net/hash

like image 64
bimbom22 Avatar answered Oct 12 '22 11:10

bimbom22


According to Wikipedia's MD5 article:

"The security of the MD5 hash function is severely compromised."

So adding MD5 to a SHA1 is not gonna make your thing more secure. I would even say that hashing an already hashed thing is not gonna make it more secure either.

A common mechanism that many people use for storing passwords is a salt encription over a hashed string.

like image 39
elitalon Avatar answered Oct 12 '22 10:10

elitalon


Since no one answered the original question: Yes, it is possible.

As to the second question: md5(sha1('password')) will actually reduce security compared to just using sha1 because the hash size will be reduced. And the other way around doesn't help either.

Always use salting!

like image 43
Axel Avatar answered Oct 12 '22 10:10

Axel