This password generator allows you to generate passwords from a password pattern.
The function is
string genPassword(string $pattern[, array $chardef]).
Every char in $pattern has a specific meaning which is defined in $chardef. By default the following chars are set:
v => lowercase vowels
c => lowercase consonants
V => uppercase vowels
C => uppercase consonants
w => uppercase & lowercase vowels,
d => uppercase & lowercase consonants,
a => lowercase alphabet,
A => uppercase alphabet,
b => uppercase & lowercase alphabet
# => special chars: !@#$%^&*(){}[]:;-=\\_+|<>?,./
0 => numbers
y => numbers & lowercase alphabet
Y => numbers & uppercase alphabet
x => numbers & uppercase & lowercase alphabet
z => all previously mentioned chars together
<?
echo(genPassword("cv0cv0cv"));
/* generates a pronouncable and relatively easy to remember but hardly crackable password */
echo(genPassword("zzzzzzzzzz"));
/* generates a completely random, hard to crack password. */
/* use your creativity to make other patterns. */
echo(genPassword("xxxxxxxx",array('x'=>'abcdef0123456789')));
/* generates a password, just containing hexadecimal numbers */
?>