Een optie van dit pakket is de mogelijkheid om uitspreekbare wachtwoorden te maken.
Het maken van een uitspreekbaar wachtwoord:
<?php
require_once "Text/Password.php";
echo "Creating pronounceable password of 10 chars....: ";
echo Text_Password::create() . "\n\n";
echo "Creating 3 different pronounceable passwords...: ";
print_r(Text_Password::createMultiple(3));
?>
Behalve uitspreekbare wachtwoorden, kan Text_Password ook wachtwoorden genereren die niet uitspreekbaar zijn.
Het maken van een niet uitspreekbaar wachtwoord:
<?php
require_once "Text/Password.php";
echo "\nCreating unpronounceable password of 8 chars with a,b,c as possible chars....:\t";
echo Text_Password::create(8, 'unpronounceable', 'a,b,c') . "\n\n";
echo "\nCreating 4 different unpronounceable passwords...:\n";
print_r(Text_Password::createMultiple(4, 10, 'unpronounceable'));
echo "\nCreating unpronounceable password of 8 chars with numeric chars:\t";
echo Text_Password::create(8, 'unpronounceable', 'numeric') . "\n\n";
echo "\nCreating unpronounceable password of 8 chars with alphanumeric chars:\t";
echo Text_Password::create(8, 'unpronounceable', 'alphanumeric') . "\n\n";
?>
Text_Password levert de mogelijkheid om een wachtwoord te maken dat is gebaseerd op een gegeven string. In de meeste gevallen is die string een username voor een authenticatie systeem.
Het maken van wachtwoorden gebaseerd op een gegeven string:
<?php
require_once "Text/Password.php";
echo "\nCreating password from login 'olivier', type is 'reverse':\t";
echo Text_Password::createFromLogin('olivier', 'reverse') . "\n\n";
echo "\nCreating password from login 'olivier', type is 'rot13':\t";
echo Text_Password::createFromLogin('olivier', 'rot13') . "\n\n";
echo "\nCreating password from login 'olivier', type is 'rotx':\t";
echo Text_Password::createFromLogin('olivier', 'rotx', 13) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'rotx++':\t";
echo Text_Password::createFromLogin('olivier', 'rotx++', 13) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'rotx--':\t";
echo Text_Password::createFromLogin('olivier', 'rotx--', 13) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'xor':\t";
echo Text_Password::createFromLogin('olivier', 'xor', 5) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'ascii_rotx':\t";
echo Text_Password::createFromLogin('olivier', 'ascii_rotx', 5) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'ascii_rotx++':\t";
echo Text_Password::createFromLogin('olivier', 'ascii_rotx++', 5) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'ascii_rotx--':\t";
echo Text_Password::createFromLogin('olivier', 'ascii_rotx--', 5) . "\n\n";
echo "\nCreating password from login 'olivier', type is 'shuffle':\t";
echo Text_Password::createFromLogin('olivier', 'shuffle', 1) . "\n\n";
echo "\nCreating password from an array of login 'olivier', 'martin', 'vanhoucke', 'jansen', type is 'reverse':\n";
$logins = array('olivier', 'martin', 'vanhoucke', 'jansen');
print_r(Text_Password::createMultipleFromLogin($logins, 'reverse'));
?>
Op dit moment zij de volgende obfuscation algorithms ondersteund:
xor
rotx
rotx++
rotx--
ascii_rotx
ascii_rotx++
ascii_rotx--
shuffle
reverse