<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ajax Updates &#187; google like password</title>
	<atom:link href="http://www.ajaxupdates.com/tag/google-like-password/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxupdates.com</link>
	<description>Latest Ajax Scripts, Examples, News and other Ajax related stuff</description>
	<lastBuildDate>Fri, 12 Feb 2010 12:46:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Make a Password Strength Meter Like Google</title>
		<link>http://www.ajaxupdates.com/make-a-password-strength-meter-like-google/</link>
		<comments>http://www.ajaxupdates.com/make-a-password-strength-meter-like-google/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:32:10 +0000</pubDate>
		<dc:creator>alyaspk</dc:creator>
				<category><![CDATA[Ajax Scripts]]></category>
		<category><![CDATA[Forms / Fields]]></category>
		<category><![CDATA[google like password]]></category>
		<category><![CDATA[google password]]></category>
		<category><![CDATA[password like google]]></category>
		<category><![CDATA[Password Meter]]></category>
		<category><![CDATA[password strength]]></category>
		<category><![CDATA[pasword stronger]]></category>
		<category><![CDATA[Strength Meter]]></category>

		<guid isPermaLink="false">http://www.ajaxupdates.com/?p=4118</guid>
		<description><![CDATA[Password strength meters are becoming more and more popular amongst web services. Google uses one when creating a Google account. One can argue how useful these meters really are, but non-the-less they are fairly cool for users. So how does one go about making one of these meters? Well it’s fairly straight forward.
The basic break [...]


Related Listings:<ol><li><a href='http://www.ajaxupdates.com/password-strength-estimates-brute-force-time-jquery-plugin/' rel='bookmark' title='Permanent Link: Password Strength &#8211; Estimates brute force time jQuery plugin'>Password Strength &#8211; Estimates brute force time jQuery plugin</a> <small>This plugin shows the strength of you passwords by telling...</small></li>
<li><a href='http://www.ajaxupdates.com/password-fields-with-strength-meter/' rel='bookmark' title='Permanent Link: Password Fields With strength Meter'>Password Fields With strength Meter</a> <small>This script is built with no framework. It works based...</small></li>
<li><a href='http://www.ajaxupdates.com/show-simple-password-fields/' rel='bookmark' title='Permanent Link: Show Simple Password Fields'>Show Simple Password Fields</a> <small>A simple Javascript bookmarklet shows password field values. In form...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Password strength meters are becoming more and more popular amongst web services. Google uses one when creating a Google account. One can argue how useful these meters really are, but non-the-less they are fairly cool for users. So how does one go about making one of these meters? Well it’s fairly straight forward.</p>
<p>The basic break down is we add an event handler on your password field that will check the password for every key input the user types. This allows for an updated meter as the user types the password. When you get into the algorithm that actually checks how secure a password is, there are many routes you can go. When researching for this project, I chose to base my code off of the kind folks over at Intelligent Web. There theory is to calculate how many different combinations there are for the password you enter, then determine how many days it would take to crack your password. The algorithm returns a percentage that we then in turn convert to a nice GUI for the end user to see. So let’s take a look at the code:</p>
<p>The JavaScript is fairly straight forward. There are settings at the top for different checks to enable or disable. Here is the JavaScript:</p>
<pre class="brush: javascript"> // Password strength meter v1.0
// Matthew R. Miller – 2007
// www.codeandcoffee.com
// Based off of code from http://www.intelligent-web.co.uk

// Settings
// — Toggle to true or false, if you want to change what is checked in the password
var bCheckNumbers = true;
var bCheckUpperCase = true;
var bCheckLowerCase = true;
var bCheckPunctuation = true;
var nPasswordLifetime = 365;

// Check password
function checkPassword(strPassword)
{
// Reset combination count
nCombinations = 0;

// Check numbers
if (bCheckNumbers)
{
strCheck = “0123456789″;
if (doesContain(strPassword, strCheck) &gt; 0)
{
nCombinations += strCheck.length;
}
}

// Check upper case
if (bCheckUpperCase)
{
strCheck = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
if (doesContain(strPassword, strCheck) &gt; 0)
{
nCombinations += strCheck.length;
}
}

// Check lower case
if (bCheckLowerCase)
{
strCheck = “abcdefghijklmnopqrstuvwxyz”;
if (doesContain(strPassword, strCheck) &gt; 0)
{
nCombinations += strCheck.length;
}
}

// Check punctuation
if (bCheckPunctuation)
{
strCheck = “;:-_=+\|//?^&amp;amp;!.@$Â£#*()%~&lt;&gt;{}[]“;
if (doesContain(strPassword, strCheck) &gt; 0)
{
nCombinations += strCheck.length;
}
}

// Calculate
// — 500 tries per second =&gt; minutes
var nDays = ((Math.pow(nCombinations, strPassword.length) / 500) / 2) / 86400;

// Number of days out of password lifetime setting
var nPerc = nDays / nPasswordLifetime;

return nPerc;
}

// Runs password through check and then updates GUI
function runPassword(strPassword, strFieldID)
{
// Check password
nPerc = checkPassword(strPassword);

// Get controls
var ctlBar = document.getElementById(strFieldID + “_bar”);
var ctlText = document.getElementById(strFieldID + “_text”);
if (!ctlBar || !ctlText)
return;

// Set new width
var nRound = Math.round(nPerc * 100);
if (nRound &lt; (strPassword.length * 5))
{
nRound += strPassword.length * 5;
}
if (nRound &gt; 100)
nRound = 100;
ctlBar.style.width = nRound + “%”;

// Color and text
if (nRound &gt; 95)
{
strText = “Very Secure”;
strColor = “#3bce08″;
}
else if (nRound &gt; 75)
{
strText = “Secure”;
strColor = “orange”;
}
else if (nRound &gt; 50)
{
strText = “Mediocre”;
strColor = “#ffd801″;
}
else
{
strColor = “red”;
strText = “Insecure”;
}
ctlBar.style.backgroundColor = strColor;
ctlText.innerHTML = “” + strText + ““;
}

// Checks a string for a list of characters
function doesContain(strPassword, strCheck)
{
nCount = 0;

for (i = 0; i &lt; strPassword.length; i++)
{
if (strCheck.indexOf(strPassword.charAt(i)) &gt; -1)
{
nCount++;
}
}

return nCount;
}  </pre>
<p>On the HTML side, I have setup a simple form to display the interaction the user will receive.<br />
<!--adsense--><br />
Demo: <a href="http://www.codeandcoffee.com/2007/06/how-to-make-a-password-strength-meter-like-google/">http://www.codeandcoffee.com/2007/06/how-to-make-a-password-strength-meter-like-google/</a><br />
Download: <a href="http://www.codeandcoffee.com/wp-content/uploads/pwd_strength.js">http://www.codeandcoffee.com/wp-content/uploads/pwd_strength.js</a><br />
Source: <a href="http://www.codeandcoffee.com/2007/06/how-to-make-a-password-strength-meter-like-google/">http://www.codeandcoffee.com/2007/06/how-to-make-a-password-strength-meter-like-google/</a></p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fwww.ajaxupdates.com%2Fmake-a-password-strength-meter-like-google%2F', 'Make+a+Password+Strength+Meter+Like+Google')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fwww.ajaxupdates.com%2Fmake-a-password-strength-meter-like-google%2F', title: '+Make+a+Password+Strength+Meter+Like+Google+' })"/></div>

<p>Related Listings:<ol><li><a href='http://www.ajaxupdates.com/password-strength-estimates-brute-force-time-jquery-plugin/' rel='bookmark' title='Permanent Link: Password Strength &#8211; Estimates brute force time jQuery plugin'>Password Strength &#8211; Estimates brute force time jQuery plugin</a> <small>This plugin shows the strength of you passwords by telling...</small></li>
<li><a href='http://www.ajaxupdates.com/password-fields-with-strength-meter/' rel='bookmark' title='Permanent Link: Password Fields With strength Meter'>Password Fields With strength Meter</a> <small>This script is built with no framework. It works based...</small></li>
<li><a href='http://www.ajaxupdates.com/show-simple-password-fields/' rel='bookmark' title='Permanent Link: Show Simple Password Fields'>Show Simple Password Fields</a> <small>A simple Javascript bookmarklet shows password field values. In form...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.ajaxupdates.com/make-a-password-strength-meter-like-google/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->