The following list details (IMO) the steps necessary to move from plaintext passwords to storing hashed passwords, and also moving the infrastructure (password resets, initial sign-up etc.) to accomodate hashed passwords. All steps can be taken without interruption. I'm not sure if my approach of using hashes for "activation" and then resetting the password only when that "activation" hash is submitted, together with the appropriate user id in the appropriate timeframe is sensible.
Discussion of the approach and/or the other changes is very much welcome, as is a discussion of what I named things. I'm bad at naming things, especially.
select user_id from activate_user where user_id = :$user_id and activation_hash = :$activation_hash and expires > now()
INSERT into pending_activations user_id, hash, expiry
$hash = &generate_hash( $USER, $passwd ); # ... confirm via hash my $ok = $hash eq $USER->{passwd_hash}; # if the hash-compare failed and the user still has a password, us +e that: if (defined $USER->{passwd}) { ... confirm via passwd }
Update: Corrected node links, added topics as per ig's reply below
Further Update: Found out that MySQL doesn't support functions in default values. Changed names to fit reality.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Steps for the migration to hashed passwords
by ig (Vicar) on Aug 12, 2009 at 21:14 UTC | |
by Corion (Patriarch) on Aug 12, 2009 at 21:24 UTC |