For human-readable passwords, I recently used a PHP script very similar to the one below. It worked well. Granted, the passwords aren't going to be incredibly secure (as they're prone to dictionary attacks), but for memorisable, or at least readable, passwords it works well. However, this function shouldn't be used as-is, it's more for illustration than anything else.
function generatePassword($syllables = 2, $use_prefix = true)
{
// Define function unless it is already exists
if (!function_exists('arr'))
{
// This function returns random array element
function arr(&$arr)
{
return $arr[rand(0, sizeof($arr)-1)];
}
}
// Random prefixes
$prefix = array('aero', 'anti', 'auto', 'bi', 'bio',
'cine', 'deca', 'demo', 'dyna', 'eco',
'ergo', 'geo', 'gyno', 'hypo', 'kilo',
'mega', 'tera', 'mini', 'nano', 'duo',
'an', 'arch', 'auto', 'be', 'co',
'counter', 'de', 'dis', 'ex', 'fore',
'in', 'infra', 'inter', 'mal',
'mis', 'neo', 'non', 'out', 'pan',
'post', 'pre', 'pseudo', 'semi',
'super', 'trans', 'twi', 'vice');
// Random suffixes
$suffix = array('dom', 'ity', 'ment', 'sion', 'ness',
'ence', 'er', 'ist', 'tion', 'or',
'ance', 'ive', 'en', 'ic', 'al',
'able', 'y', 'ous', 'ful', 'less',
'ise', 'ize', 'ate', 'ify', 'fy', 'ly');
// Vowel sounds
$vowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo', 'ae', 'ea', 'ie');
// Consonants
$consonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j',
'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');
$password = $use_prefix?arr($prefix):'';
$password_suffix = arr($suffix);
for($i=0; $i<$syllables; $i++)
{
// selecting random consonant
$doubles = array('n', 'm', 't', 's');
$c = arr($consonants);
if (in_array($c, $doubles)&&($i!=0)) { // maybe double it
if (rand(0, 2) == 1) // 33% probability
$c .= $c;
}
$password .= $c;
//
// selecting random vowel
$password .= arr($vowels);
if ($i == $syllables - 1) // if suffix begin with vovel
if (in_array($password_suffix[0], $vowels)) // add one more consonant
$password .= arr($consonants);
}
// selecting random suffix
$password .= $password_suffix;
return $password;
}