Jump to content

Recommended Posts

Hi,

 

I could of sworn I have seen someone post in a thread as to why it makes the original hash less secure, but I am having no luck in finding that post.

 

So, why is...(for example)

$hash = md5(md5('password+salt'));

...bad?

 

I can see why it's redundant, but I don't understand how it makes the hash less secure?

 

Thanks,

Ace

Link to comment
https://forums.phpfreaks.com/topic/247241-why-is-hashing-a-hash-bad-practice/
Share on other sites

The main thing is it makes the hash larger and increases the chances of collisions. Instead of doing double md5's I would do the inner md5 and the outside sha1. But a good unique salt would do better than doing an inner md5 hash. But yea, that is the main reason why it would be considered bad practice.

 

What is a collision? Basically it increases the chances that user X's hash is the same as user's Y's which can be a security breach if someone by chance figures out an exploit or accidentally gets authenticated as that user.

 

Edit:

Along side of that, it would also increase the chance that a brute force attack would be successful, as with the collisions, it could mean that they could do less attacks and perhaps get "lucky".

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.