What is the best way to check the strength of a password?

后端 未结 15 1282
孤独总比滥情好
孤独总比滥情好 2020-12-02 10:41

What is the best way of ensuring that a user supplied password is a strong password in a registration or change password form?

One idea I had (in python)

<         


        
15条回答
  •  无人及你
    2020-12-02 11:04

    With a series of checks to ensure it meets minimum criteria:

    • at least 8 characters long
    • contains at least one non-alphanumeric symbol
    • does not match or contain username/email/etc.
    • etc

    Here's a jQuery plugin that reports password strength (not tried it myself): http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/

    And the same thing ported to PHP: http://www.alixaxel.com/wordpress/2007/06/09/php-password-strength-algorithm/

提交回复
热议问题