Blame
Date:
Sun Dec 27 01:56:09 2020 UTC
Message:
Updated p5-Class-DBI-SQLite-0.11p2
01
2020-10-20
jrmu
#!/usr/bin/perl
02
2020-10-20
jrmu
03
2020-10-20
jrmu
package Hash;
04
2020-10-20
jrmu
05
2020-10-20
jrmu
use strict;
06
2020-10-20
jrmu
use warnings;
07
2020-10-20
jrmu
use OpenBSD::Pledge;
08
2020-10-20
jrmu
use OpenBSD::Unveil;
09
2020-11-05
jrmu
use Data::Dumper;
10
2020-10-20
jrmu
11
2020-11-15
jrmu
my %conf = %main::conf;
12
2020-10-20
jrmu
my @words;
13
2020-10-20
jrmu
my $wordspath = "words";
14
2020-11-15
jrmu
my $passlength = $conf{passlength};
15
2020-11-15
jrmu
# dictionary words for passwords
16
2020-11-15
jrmu
@words = main::readarray("words");
17
2020-10-20
jrmu
18
2020-10-20
jrmu
sub init {
19
2020-10-20
jrmu
unveil($wordspath, "r") or die "Unable to unveil $!";
20
2020-10-20
jrmu
}
21
2020-10-20
jrmu
22
2020-10-20
jrmu
sub newpass {
23
2020-10-20
jrmu
my $len = scalar @words;
24
2020-10-20
jrmu
my $pass;
25
2020-10-20
jrmu
for (my $i=0; $i < $passlength; $i++) {
26
2020-10-20
jrmu
my $word = $words[int(rand($len))];
27
2020-10-20
jrmu
$word =~ s/(\w+)/\u$1/g;
28
2020-10-20
jrmu
$pass .= $word;
29
2020-10-20
jrmu
}
30
2020-10-20
jrmu
return $pass;
31
2020-10-20
jrmu
}
32
2020-10-27
jrmu
#dependencies for blowfish
33
2020-10-27
jrmu
#unveil("./blowfish.o", "rx") or die "Unable to unveil $!";
34
2020-10-27
jrmu
# } elsif ($reply =~ /^!identify\s*(.*)?\s+(.*)$/i) {
35
2020-10-27
jrmu
# my $hash = getkeyval($hostmask, "password");
36
2020-10-27
jrmu
# #print "result = ".`./blowfish.o $2 '$hash'`;
37
2020-10-27
jrmu
# if(system("./blowfish.o $2 '$hash' > /dev/null")) {
38
2020-10-27
jrmu
# print "login failed\r\n";
39
2020-10-27
jrmu
# } else {
40
2020-10-27
jrmu
# print "logged in\r\n";
41
2020-10-27
jrmu
# }
42
2020-10-27
jrmu
43
2020-10-20
jrmu
44
2020-10-20
jrmu
1; # MUST BE LAST STATEMENT IN FILE