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

后端 未结 15 1251
孤独总比滥情好
孤独总比滥情好 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:17

    The two simplest metrics to check for are:

    1. Length. I'd say 8 characters as a minimum.
    2. Number of different character classes the password contains. These are usually, lowercase letters, uppercase letters, numbers and punctuation and other symbols. A strong password will contain characters from at least three of these classes; if you force a number or other non-alphabetic character you significantly reduce the effectiveness of dictionary attacks.

提交回复
热议问题