Recipe 55Validating Password Strength

Task

Suppose your task is to check whether the passwords entered by users when signing up for a user account on your website are resistant to guessing or brute-force attacks. Usually, companies establish a password policy that outlines the criteria for creating and using passwords, which set requirements such as:

  • Having a minimum length of 8 characters or more
  • Containing both uppercase and lowercase letters
  • Containing one or more numerical digits
  • Containing special characters like @, #, $, etc
  • Forbidding words listed in the password blocklist
  • Forbidding words related to the user’s personal information
  • Forbidding the use of the company name or its abbreviation
  • Forbidding passwords that match the date of birth, license ...

Get Text Processing with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.