Random Pronounceable Passwords

Description: Produces nice random-yet-pronounceable passwords.

<?PHP
 
FUNCTION auth_pwgen(){
  $pw = '';
  $c  = 'bcdfghjklmnprstvwz'; //consonants except hard to speak ones
  $v  = 'aeiou';              //vowels
  $a  = $c.$v;                //both
 
  //use two syllables...
  FOR($i=0;$i < 2; $i++){
    $pw .= $c[RAND(0, STRLEN($c)-1)];
    $pw .= $v[RAND(0, STRLEN($v)-1)];
    $pw .= $a[RAND(0, STRLEN($a)-1)];
  }
  //... and add a nice number
  $pw .= RAND(10,99);
 
  RETURN $pw;
}
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.