Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

MooTools plugin that displays a password strength meter for an input field.

Notifications You must be signed in to change notification settings

nak5ive/Form.PasswordStrength

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Form.PasswordStrength

Places an animated meter below an input element, displaying the strength of a password calculated using simple information entropy.

Screenshot

How to use

Include Mootools.Core and Form.PasswordStrength in your document:

<script type="text/javascript" src="mootools-1.3.1-core-yc.js"></script>
<script type="text/javascript" src="Form.PasswordStrength.js"></script>

Instantiate a new Form.PasswordStrength object and set it's options:

<input id="mypassword" type="password" name="mypassword" value=""/>

<script type="text/javascript">
	new Form.PasswordStrength('mypassword', {options});
</script>

Options

threshold - An entropy value that represents the highest password strength to measure. In this application, entropy is a measure of strength dependent on the length of a string and the sample size of characters for which a brute force attack must consider when looking for a match. Defaults to 66 (the entropy value for a 10-character string consisting of at least 1 number, 1 lowercase letter, 1 uppercase letter, and 1 special character).

primer - A sample string that represents the highest password strength to measure. Since strength in entropy is relative to what is considered to be "strong", it can be difficult to guess a number value to represent threshold. Set this option with a string that has all the characteristics you would expect in a "strong" password. This option will override the threshold option. Defaults to ''.

height - The height of the strength meter, in px. Defaults to 5.

opacity - The opacity of the strength meter, from 0 to 1. Defaults to 1.

bgcolor - The background-color style attribute on the strength meter. Defaults to 'transparent'.

Events

onUpdate - Fired every time the value of the input field changes. Arguments available [element, strength, threshold].

About

MooTools plugin that displays a password strength meter for an input field.

Resources

Stars

Watchers

Forks

Packages

No packages published