Changes

Jump to: navigation, search

WebAppSec/Secure Coding Guidelines

1,202 bytes added, 23:20, 3 January 2011
Password Storage
* {salt} is a salt unique per-user,
* {hash} is algo(salt + password)
 
 
'''Migration'''
 
Migrate all password hashes entries in the database as follows. This is a one time, offline migration.
 
Stored in databases in form: {algo}-{salt}-{migration_hash}
* {algo} is {SHA512+MD5},
* {salt} is a salt unique per-user,
* {migration_hash} is SHA512(salt + existingPasswordHash)
 
'''New hash process for new accounts or password changes:'''<br>
Use standard hashing process [[http://mozilla.org above]]
 
'''New Login Process'''<br>
1. Attempt to login user with migration hash. This involves performing the old password hash procedure then adding the salt and finally performing the SHA512.
Example: Old password hash process is md5
Migration Hash = SHA512(perUserSalt + md5(user supplied password))
2. If authentication via migration hash is successful:
- Use the user's provided password and calculate the New Hash per the algorithm defined above.
- Overwrite the Migration Hash with the New Hash
3. If authentication via migration hash is NOT successful:
- The user may already be on the New Hash. Attempt to directly authenticate using the new hash. If this fails, then the password provided by the user is wrong.
 
 
 
 
<hr>
<old process below - to be removed>
* If upgrading from an existing scheme such as md5 hashing with no-salt, then a conversion process can be established. This conversion will occur whenever a user logs into the system. First attempt to authenticate the user via the above scheme (e.g. unique salt and sha-512). If that fails then authenticate via the old scheme (e.g. md5) and create a new hash in the above scheme(e.g. unique salt and sha-512). Remember to also clear out the old hash value after the conversion is complete for the user.
* After a six month period of changing from md5 to sha-512, all md5 hash entries should be cleared from the system.
Confirm
491
edits

Navigation menu