Adding a password strength indicator
Users like to create a really simple password that is easy to remember, such as cat, john, or even password. However, most people, especially web developers, know that these types of passwords are too insecure and are incredibly easy to decrypt from an encrypted database using techniques such as a dictionary attack, for example. Password strength indicators are useful to nudge the user in the right direction of using more complex passwords.
To be able to validate password strength, we need to create some rules that our code will use. There are no hard-and-fast rules regarding this, but plenty of information can be found online about what types of passwords are best. We will give the password a score ...