MD5 Hash Salting

shultzc - September 1, 2006 - 06:08
Project:Drupal
Version:6.x-dev
Component:user system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Drupal should have a salting variable set in its configuration that it prepends or appends to passwords prior to computing the MD5 hash for the database. This would increase security by rendering pre-computed dictionary attacks useless without the salt, which could/should be stored as a server variable outside the database so that even if someone compromises the RDBMS then the passwords are safe.

I have a great deal of experience writing modules and classes for Drupal for work in-house and would be willing to tackle this if I have some agreement in principle that this is a good idea.

Thank you.

#1

erdemkose - September 1, 2006 - 07:14
Version:4.7.3» x.y.z
Component:user.module» user system
Category:bug report» feature request

I aggree that salting is important. But I have a question. How can we replace old passwords?

I think a helper module must be written. It will replace user password hash with a salted hash while signing in and keep track of which password hashes are salted. And when all the password hashes are salted, it must create a watchdog entry to be removed.

Any better solution?

*Since this is a feature request I have moved it to cvs. New features will be included in cvs version only.

#2

shultzc - September 1, 2006 - 08:12

I agree, that's probably the safest way to do it.

#3

Egon Bianchet - December 16, 2006 - 22:11
Version:x.y.z» 6.x-dev

#4

selmanj - November 24, 2007 - 00:03
Status:active» duplicate

Duplicate of http://drupal.org/node/29706

#5

gravisrs - September 19, 2008 - 11:09

I think I've found best solution.

For user table add field called salt which is null by default. This field will be generated automatically as a random bytes during user register and password recovery, and will be concatenated with password before creating & saving hash to database.

This will preserve old accounts (null added to password won't change hash) and will implement anti-rainbow security.

 
 

Drupal is a registered trademark of Dries Buytaert.