Book Image

jQuery 2.0 Development Cookbook

By : Leon Revill
Book Image

jQuery 2.0 Development Cookbook

By: Leon Revill

Overview of this book

Table of Contents (17 chapters)
jQuery 2.0 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.

Getting ready

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 out of five, one point for each of the following rules:

  • It is greater than six characters in length

  • It is greater than eight characters

  • It has both upper and lowercase characters

  • It has at least one number

  • It has one of the following symbols: @, $,...