line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
24981
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Crypt::Rijndael::MySQL; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use base 'Crypt::Rijndael'; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
800
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
4
|
|
|
4
|
1
|
33
|
my $class = shift; |
12
|
4
|
|
|
|
|
6
|
my $key = shift; |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
|
|
18
|
my @parts = unpack '(A16)*', $key; |
15
|
4
|
|
|
|
|
7
|
$key = "\0" x 16; |
16
|
4
|
|
|
|
|
14
|
$key ^= $_ foreach @parts; |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
|
|
48
|
my $self = $class->SUPER::new($key, @_); |
19
|
4
|
|
|
|
|
17
|
bless $self, $class; # force |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub encrypt { |
23
|
4
|
|
|
4
|
1
|
1114
|
my $self = shift; |
24
|
4
|
|
|
|
|
5
|
my $data = shift; |
25
|
|
|
|
|
|
|
|
26
|
4
|
|
|
|
|
9
|
my $complement = 16 - length($data) % 16; |
27
|
4
|
|
|
|
|
42
|
$self->SUPER::encrypt($data . (chr($complement) x $complement), @_); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub decrypt { |
31
|
4
|
|
|
4
|
1
|
4
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
22
|
my $data = $self->SUPER::decrypt(@_); |
34
|
|
|
|
|
|
|
|
35
|
4
|
|
|
|
|
7
|
my $complement = ord substr($data, -1); |
36
|
4
|
50
|
|
|
|
13
|
if (substr($data, -$complement) ne chr($complement) x $complement) { |
37
|
0
|
|
|
|
|
0
|
require Carp; |
38
|
0
|
|
|
|
|
0
|
Carp::croak('Incorrect padding (wrong password or broken data?)'); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
4
|
|
|
|
|
18
|
substr($data, 0, length($data) - $complement); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |