View Full Version : [DHTML] Password Strength

07-08-2007, 02:53 PM
Sorry if my English isn't very good and contains orthographic errors ;)

1) CODE TITLE: Password Strength

2) AUTHOR NAME/NOTES: Albert Filella

"Password Strenght" script displays an attractive strenght password bar. It indicates if a password is safe considering the following tips for create a secure password:

Include punctuation marks or symbols
Mix capital and lowercase letters.
Include numbers.

The zip contains the .js & .html demo file.

07-08-2007, 03:09 PM
I set up the demo on my home server if anyone wants to check it out without downloading the zip file. The demo can be found here:


The script is nice, and I could see a use for it in the future on one of the projects that I plan to start within the next few months. So far I have tested it in IE7 and FF2. Not sure about any other browsers yet.

07-08-2007, 03:12 PM
i tested it in Safari

thnx for upload it in your site :)

07-09-2007, 04:34 AM
Works in Opera.

07-09-2007, 05:17 AM
I like this script. Just added it to a project I'm working on.

There is a major inaccuracy in its calculation, though, in that the length of a password is a major consideration. According to this, aaaaaa and aaaaaaaaaaaaaaaa are there same strength, when this is definitely not the case, especially when talking about brute force, which is likely what this is guarding against.

To fix this, I added a couple lines that, to me, approximate well the influence of the length.
The existing lines before and after are also included. New lines in bold:

if (isSymbol(value) == false) security_level+=1;
if (size-min_length>=2&&security_level<3) security_level++;
if (size-min_length>=5&&security_level<3) security_level++;
if (size-min_length>=8&&security_level<3) security_level++;
if (size<min_length) final_status = minimum;
if (size>=min_length) final_status = security_status[security_level];

07-09-2007, 09:13 PM
yes, if password is longer the strength must be higher, but adding these lines the script indicates that (example) "kkkkkkkkkkkkkk" password strength is Strong.

In the next revision i need to merge the size & strength for accurate the result

thnx for all