You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
303 B
Plaintext
21 lines
303 B
Plaintext
4 years ago
|
#!/usr/bin/perl
|
||
|
|
||
|
$| = 1;
|
||
|
|
||
|
print "plaintext> ";
|
||
|
while (<>) {
|
||
|
chomp;
|
||
|
$result = &mkpasswd($_);
|
||
|
print "\t$result\n";
|
||
|
print "plaintext> ";
|
||
|
}
|
||
|
|
||
|
sub mkpasswd {
|
||
|
my $what = $_[0];
|
||
|
my $salt = chr(65+rand(27)).chr(65+rand(27));
|
||
|
$salt =~ s/\W/x/g;
|
||
|
|
||
|
return crypt($what, $salt);
|
||
|
}
|
||
|
|