File: makepasswd

package info (click to toggle)
blootbot 1.1.0-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,420 kB
  • ctags: 586
  • sloc: perl: 15,941; sh: 154; makefile: 56; sql: 45
file content (20 lines) | stat: -rwxr-xr-x 303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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);
}