David Taylor
9238767f7e
FEATURE: Persist password hashing algorithm/params in database ( #20980 )
...
Previously, Discourse's password hashing was hard-coded to a specific algorithm and parameters. Any changes to the algorithm or parameters would essentially invalidate all existing user passwords.
This commit introduces a new `password_algorithm` column on the `users` table. This persists the algorithm/parameters which were use to generate the hash for a given user. All existing rows in the users table are assumed to be using Discourse's current algorithm/parameters. With this data stored per-user in the database, we'll be able to keep existing passwords working while adjusting the algorithm/parameters for newly hashed passwords.
Passwords which were hashed with an old algorithm will be automatically re-hashed with the new algorithm when the user next logs in.
Values in the `password_algorithm` column are based on the PHC string format (https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md ). Discourse's existing algorithm is described by the string `$pbkdf2-sha256$i=64000,l=32$`
To introduce a new algorithm and start using it, make sure it's implemented in the `PasswordHasher` library, then update `User::TARGET_PASSWORD_ALGORITHM`.
2023-04-11 10:16:28 +01:00
..
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-03-16 16:09:22 +01:00
2023-01-20 12:52:49 -06:00
2023-03-27 09:22:38 -05:00
2023-01-09 12:10:19 +00:00
2023-01-12 10:04:46 +10:00
2023-02-27 17:20:00 +01:00
2023-02-16 10:47:01 +00:00
2023-02-20 06:20:47 +03:00
2023-01-09 12:10:19 +00:00
2023-03-24 10:16:53 +10:00
2023-03-16 15:27:09 -06:00
2023-03-16 15:27:09 -06:00
2023-03-22 23:31:33 +02:00
2023-01-31 16:53:24 +01:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-09 16:24:24 +00:00
2023-03-10 17:17:59 +08:00
2023-04-03 11:46:39 +01:00
2023-03-01 12:45:33 +01:00
2023-03-30 14:39:55 +11:00
2023-03-30 08:35:06 -04:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-16 09:08:44 +11:00
2023-04-03 11:09:36 -03:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-04-05 12:28:16 +01:00
2023-02-16 18:15:56 +03:00
2023-03-29 11:54:25 -04:00
2023-01-09 12:10:19 +00:00
2023-03-13 08:09:38 +08:00
2023-02-23 07:47:11 +10:00
2023-04-04 19:52:11 +03:00
2023-01-09 12:10:19 +00:00
2023-03-21 10:40:42 -04:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-27 12:28:47 +08:00
2023-01-05 08:43:58 +10:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-01 09:55:21 +00:00
2023-01-09 12:10:19 +00:00
2023-02-21 10:30:48 +01:00
2023-02-21 10:30:48 +01:00
2023-01-09 12:10:19 +00:00
2023-02-21 10:30:48 +01:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-03-16 15:27:09 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-10 22:38:52 +02:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-27 18:43:28 +01:00
2023-01-09 12:10:19 +00:00
2023-03-30 14:39:55 +11:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-20 09:50:24 +08:00
2023-01-09 12:10:19 +00:00
2023-04-10 13:54:55 -05:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-01 08:58:32 +11:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-21 10:30:48 +01:00
2023-03-08 15:27:17 +10:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-25 18:55:01 +02:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-03-23 15:16:05 +11:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-22 10:19:59 +10:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-25 18:55:33 +02:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-03 10:02:14 +08:00
2023-01-09 12:10:19 +00:00
2023-04-11 10:16:28 +01:00
2023-04-05 17:00:05 +01:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-21 10:30:48 +01:00
2023-03-02 16:40:53 +01:00
2023-02-21 10:30:48 +01:00
2023-01-09 12:10:19 +00:00
2023-04-05 13:31:31 -05:00
2023-03-20 16:56:43 +01:00
2023-03-30 14:50:36 +10:00
2023-03-30 13:52:10 +10:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-12 09:41:39 +10:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-02-13 12:39:45 +08:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-30 14:08:19 +10:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-20 11:41:23 -05:00
2023-02-17 18:38:21 -03:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-03-06 11:41:47 +03:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-20 12:52:49 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-20 13:51:39 -05:00
2023-04-11 08:48:07 +08:00
2023-03-02 13:05:45 -03:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-31 09:03:15 +11:00
2023-01-09 12:10:19 +00:00
2023-04-11 08:48:07 +08:00
2023-03-01 15:35:21 +11:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-04-03 19:27:32 +02:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-09 11:52:26 +10:00
2023-03-23 12:01:04 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00
2023-03-16 17:51:54 -06:00
2023-01-09 12:10:19 +00:00
2023-01-09 12:10:19 +00:00