necesito un script que me genere claves seguras. He probado con uno que he encontrado en el manual oficial de PHP:
Código PHP:
<?PHP
// ->
define('CHARPOOL', 'ABC..YZab..yz0..9'); // The characters that may appear in the password.
define('CHARPOOL_MAXINDEX', strlen(CHARPOOL)-1); // maximum character index of a string is length-1
define('PASSWORD_LENGTH', 8); // The length of the generated password. To generate passwords with variable length use mt_rand(min_length,max_length) for this.
// <- You might want to use these values directly within the for-loop,
// but for the reason of readability they are defined as constants here.
for ($passwd=''; strlen($passwd)<PASSWORD_LENGTH; $passwd.=substr(CHARPOOL,CHARPOOL_MAXINDEX));
echo 'Generated password is: '.$passwd;
?>
Alguien puede ayudarme? Gracias.