line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::OpenSSL::Blowfish; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
827
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
119
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
116
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw/$VERSION @ISA/; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
331
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require DynaLoader; |
9
|
|
|
|
|
|
|
@ISA = qw/DynaLoader/; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.02'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
bootstrap Crypt::OpenSSL::Blowfish $VERSION; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
0
|
0
|
sub blocksize { 8; } |
16
|
0
|
|
|
0
|
0
|
0
|
sub keysize { 0; } |
17
|
0
|
|
|
0
|
0
|
0
|
sub min_keysize { 8; } |
18
|
0
|
|
|
0
|
0
|
0
|
sub max_keysize { 56; } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
26
|
my $self = {}; |
22
|
1
|
|
|
|
|
3
|
bless $self, shift; |
23
|
1
|
|
|
|
|
91
|
$self->{ks} = Crypt::OpenSSL::Blowfish::init(shift); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
3
|
$self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub encrypt { |
29
|
1
|
|
|
1
|
0
|
10
|
my ($self, $data) = @_; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
5
|
Crypt::OpenSSL::Blowfish::crypt($data, $self->{ks}, 0); |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
2
|
$data; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub decrypt { |
37
|
1
|
|
|
1
|
0
|
11
|
my ($self, $data) = @_; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
4
|
Crypt::OpenSSL::Blowfish::crypt($data, $self->{ks}, 1); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
2
|
$data; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |