in reply to Random Password Generator
The above generates a 9-char random password using Crypt::RandPasswd. If limiting the chars used, etc, is desired, read the POD for that module, as it explains how to restrict character space and other features.use Crypt::RandPasswd; print 'Password: ',Crypt::RandPasswd->chars(9,9), "\n";
If you're on a UNIX system, importing Crypt::Random will give you access to a better PRNG (using /dev/random or the EGD) that you can hand off to Crypt::RandPasswd. If you're not on UNIX, you can either install a version of EGD for your platform, or try using Crypt::Random::ISAAC - secure random number generator (which, admittedly, is something I wrote for solving the cryptographic randomness issue in pure Perl). EGD (or /dev/random) with Crypt::Random is by far the better choice, if it is available to you (better tested, more mature, etc.)
|
---|