Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hashing passwords and recovering from forgotten passwordHashing passwords and recovering from forgotten password
Previous
 
Next
New Post
5/4/2006 10:54 AM
 

Opinion - User passwords should be hashed instead of encrypted. [I didn't see a forum specifically for authentication; if this should be entered in a different forum, please let me know.]

The notes for "DotNetNuke 3.3 / 4.1 Release Status" at http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/420/Default.aspx include the following item:
- Hashed Passwords - hashed passwords are supported through the Microsoft Membership Provider. We should provide a mechanism to support hashed password in DNN as they are much more secure then encrypted passwords and do not rely on MachineKeys. ( It would be advantageous to make this the default but the side effect would be that we would no longer have a password retrieval mechanism )


Obviously, user's passwords should NOT be stored in plain text in the database (or anywhere else), although I have seen too many applications and web sites that do store passwords in plain text. Encrypting the password is a minimum good practice, however storing the hash of the password (and preferably a salted hash) is the best and recommended practice, and should be the default and perhaps only option, in my opinion.

Since a hashed password is not reversible, users cannot be emailed a forgotten password and therefore a different mechanism is required to enable users to obtain access again after forgetting their password. This mechanism should not involve human intervention (such as calling or sending email to an admin person) since this is open to social engineering attacks as well as being inconvenient.

My personal recommendation for storing passwords and recovering from forgotten passwords (for any application, not just DNN) is as follows:
(a) When a password is initially created or later modified, the hash (using a hash algorithm such as MD5) of the password is stored in the database; preferably this would be a hashed AND salted value that is stored.
(b) When the user attempts to login by entering a username and password, the password entered by the user is hashed (and salted if required) and compared to the hashed value stored in the database for the entered username. (If there is not a match, the error message should not indicate in any way whether the username was correct since this helps attackers attempting to guess usernames; it should only indicate that the login was unsuccessful).
(c) If the user forgets the password, the option to recover from this should be to generate a new random strong password and email this to the user's email account of record. Optionally, but preferable in my opinion, this new password (hashed) should be stored in a second field in the database table (not overwriting the original password) and a flag set in the table to indicate that a second password has been set for the user; this allows for the case where the user subsequently remembers the password. When the user attempts to log in in this case, either password (the original or the new generated password) should be accepted, and if either is successful, the flag for the second password should be cleared, the second password should be cleared, and the user should be required to create a new password. Optionally, but again recommended, if the temporary generated password is used to gain access, the user should also be asked for a second item of identifying information that's available in the user table (such as full name or one of the address items if those are required in the particular installation/portal).

 
New Post
2/4/2008 6:37 AM
 

Great, but how to implement the MD5 hash and salt  in DNN?

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hashing passwords and recovering from forgotten passwordHashing passwords and recovering from forgotten password


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out