Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Generate strong yet memorable passwords' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Generate strong yet memorable passwords
Authored by: laurence.wilks on Sep 23, '04 06:55:08PM
For web based applications I use the following PHP script

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# @func   randomPassword();
# @desc   Generates a random password 
# @output none
#

#function to generate a random password
function randomPassword($length)
{
	#generate a unique random password
	
	mt_srand((double)microtime() * 1000000);
	
	$possible = 'abcdefghijklmnopqrstuvwxyz0123456789' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
	
	$randompass ="";
	
	while(strlen($randompass) < $length)
	{
	
		$randompass .= substr($possible, mt_rand(0, strlen($possible) -1), 1);
	}
	
	$randompass = trim($randompass);
	
	return($randompass);
}



[ Reply to This | # ]