I think each and every one of us has seen the password strength checker besides the password field whenever signing up for an account. It is really a very nice feature that usually helps the user set a strong password for their account. It’s good for improving securities to the Important parts of a website or app like the Login/Registration Pages, making difficult for hackers to band their heads even more with the password guessing and cracking. So, let’s get started.
It is a tough feature to implement for developing developers. But not to worry, I have a superb solution for all those who want to develop such a feature besides their password field using jQuery.
What is Complexify.js?
Complexify.js is a jQuery plugin that measures the password complexity of a password field for a website. With complexify.js each and everyone who wants to create a password strength meter can easily code it and add to its website.
Let’s learn more about complexify.js in the article further.
How to Create a Password Strength Checker Meter?
To create a simple password strength checking utility, you can follow the steps below.
Let’s learn more about the above code:
Complexify.js has default function that takes options and a callback that will be called with the results of the validation.
The #password is the id of the input field of the password.
The valid argument passed to your callback function is a boolean that indicates whether the password met the minimum level of complexity.
And the complexity argument represents the appropriate percentage of the password where 100% represents a ‘very good’ password (approximately 25 random characters).
This was the basic to do with complexify.js but this is not the end. You can customize the behavior of Complexify.js library with some of the options defined in the library.
COMPLEXIFY_BANLIST: To achieve 0% complexity for a list of passwords.
minimumChars: minimum number of characters in your password. The default is 8 characters but you can set your own number of minimum characters.
strengthScaleFactor: Complexify.js has a defined scale factor that is applied to the calculated password strength. The default is 1.
There is a banned list in Complexify.js which contains passwords that are not strong and are quite easy to manipulate like: ‘123456‘, it is on the banned list of the complexify.js library.
Step 3: So, now you can apply password strength meter to your password fields too and can give your users a more definite strength to their passwords.
Try complexify.js once in your password field, it is really sweet and simple.