Protopass. Simple password strength checker for Prototype
Protopass is a simple password strength checker for the prototype library.
It is distributable under the terms of an MIT-style license.
Example protopass with default settings
Usage
Having the form
<form style="width: 240px;" action="#" method="post"><label for="password">Password</label>
<input id="password" name="password" size="30" type="password" />
</form>
<input id="password" name="password" size="30" type="password" />
</form>
call the Protopass constructor with the id of the password input field
new Protopass('password');
You can override these default options
// Text messages
messages: ["Unsafe password word!", "Too short", "Very weak", "Weak", "Medium", "Strong", "Very strong"],
// Colors for each score
colors: ["#f00", "#999", "#f00", "#c06", "#f60", "#3c0", "#2c0"],
// Common words
common: ["password", "123456", "123", "1234", "mypass", "pass", "letmein", "qwerty", "monkey", "asdfgh", "zxcvbn", "pass", 'contraseña'],
minchar: 6
messages: ["Unsafe password word!", "Too short", "Very weak", "Weak", "Medium", "Strong", "Very strong"],
// Colors for each score
colors: ["#f00", "#999", "#f00", "#c06", "#f60", "#3c0", "#2c0"],
// Common words
common: ["password", "123456", "123", "1234", "mypass", "pass", "letmein", "qwerty", "monkey", "asdfgh", "zxcvbn", "pass", 'contraseña'],
minchar: 6
by passing your defaults as the second parameter:
new Protopass('password', {
common: ['01234'],
messages: ["Contraseña insegura", "Muy corta", "Muy débil", "Débil", "Mediana", "Fuerte", "Muy fuerte"]
});
common: ['01234'],
messages: ["Contraseña insegura", "Muy corta", "Muy débil", "Débil", "Mediana", "Fuerte", "Muy fuerte"]
});
Download the code with examples or fork the source on github. MIT License.
Protopass was inspired by the Password Strength Field jQuery plugin by Tane Piper.
You might want to check my other open source projects
