It seems to me that the desire to be all-encompassing has obscured the nature of the problem. What admins want is to be able to demand a minimum strength of password, not to say specifically that a strong password has 4 or more upper alphas, two or more digits, some punctuation ...
This suggests the need for a straightforward measure of complexity which can be expressed as an integer. The UI could supply a test facility so different passwords could be tried. Edge cases such as username appearing in the password string might be handled as exceptions (I'd suggest a default option to debar them).
As an example of why this might be a good idea, consider that a 16 character string consisting only of lowercase alphas is, in general, more secure than one 8 characters long with a mixture of alphas, digits and punctuation. Reference: http://howsecureismypassword.net/
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1815660-password-policy-drupal-strength.patch | 4.62 KB | coltrane |
Comments
Comment #1
erikwebb commentedI don't disagree. Given the new architecture for 7.x-2.x, you could create a constraint that calculates this value. Then the policy would simply check against your logic.
Comment #2
erikwebb commented@alfaguru - Do you have a simple formula we should use to implement this constraint?
Comment #3
alfaguru commentedHere's the code I am using at the moment, which is a simple port of the Drupal.evaluatePasswordStrength function from user.js to PHP:
This has the advantage that we it's easy to integrate with the Drupal JS. I'd like to see something more mathematically rigorous but haven't had the time to investigate possible algos.
Comment #3.0
alfaguru commentedminor edit
Comment #4
coltraneDefinitely in favor of this. I recently was pointed at https://github.com/lowe/zxcvbn which is a JS lib for checking password strength that provides a couple of metrics that fit this idea of a "complexity level" or "strength" without demanding 1 or more specific metrics (1 number, 1 symbol etc.).
I think the configuration for this could explain how a level is defined and then allow the admin to define how high of a level to require.
Comment #5
coltraneHere's a first, but working, pass at a "Drupal strength" -- probably needs a better name and better description.
Screenshot of constraint form https://www.monosnap.com/image/jAJzHgNvnXaZgq6QWuHH6WxJ0
Comment #6
erikwebb commentedI think "Drupal strength" is as good of a name as any. Can we add some help text that explains how it works?
Comment #7
deekayen commentedComment #8
aohrvetpv commentedCommitted by deekayen here:
http://drupalcode.org/project/password_policy.git/commit/58ca4d8
Still need help text per #6 and SimpleTest tests.
Comment #9
aohrvetpv commentedComment #10
gregglesThis was fixed for the 7.x-2.x branch. For 9+ people should use https://www.drupal.org/project/password_strength so moving to fixed.