perl script for radon secure password
时间:2020-08-13 分类:Perl 作者:编程之家
@H_
502 _0@
This is my f
irs t Perl script used for daily work,record and make some explanation here.
Geto pt::Long::Config ure ("bundling");
if ($#ARGV > 0 || $#ARGV < 0 || $ARGV[0] !~ /^[0-9]+$/) {
print "\nUsage:\tOnly 1 numberic argument is ok.\n\n";
my $random = int(rand( $upper-$lower+1 )) + $lower;
while ($count < $pwdlen) {
$password=$password.chr($num);
Since this script is very simple,I won’t comment in it. Just list some points:
The script is used to generate radon password which contains lower/upper/special chara cters or numbers,which should be more secure.
Function int(),rand(),chr() are used to get integer,radon values and keyboard chara cters.
Loop while is used to get radon chara cter one by one,until length is up to limited.
#$ARGV is the number of arguments given by user,$ARGV[0] is the firs t argument.
Some output paste here:
[user@host perl]$./test1.pl Usage: Only 1 numberic argument is ok. [user@host perl]$./test1.pl 8 jMe=aoM( [user@host perl]$./test1.pl 8 9 Usage: Only 1 numberic argument is ok. [user@host perl]$./test1.pl a Usage: Only 1 numberic argument is ok.
This script also has some points can be improved,such as choosing certain types of ch
ara cter not including in the password string. Anyway this is my f
irs t useful perl script and just version 1,I’ll update it if needed.