| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Crypt::OpenToken::Cipher::DES3; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use Moose; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
29
|
|
|
4
|
1
|
|
|
1
|
|
7613
|
use Crypt::CBC; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
34
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use Crypt::DES_EDE3; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
26
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use namespace::autoclean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Crypt::OpenToken::Cipher'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
1
|
13
|
sub keysize { 24 } |
|
11
|
3
|
|
|
3
|
1
|
14
|
sub iv_len { 8 } |
|
12
|
|
|
|
|
|
|
sub cipher { |
|
13
|
3
|
|
|
3
|
1
|
10
|
my ($self, $key, $iv) = @_; |
|
14
|
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
29
|
my $cipher = Crypt::CBC->new( |
|
16
|
|
|
|
|
|
|
-key => $key, |
|
17
|
|
|
|
|
|
|
-literal_key => 1, |
|
18
|
|
|
|
|
|
|
-cipher => 'DES_EDE3', |
|
19
|
|
|
|
|
|
|
-header => 'none', |
|
20
|
|
|
|
|
|
|
-iv => $iv, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
3
|
|
|
|
|
860
|
return $cipher; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Crypt::OpenToken::Cipher::DES3 - DES3 encryption support for OpenToken |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This library can be used by C<Crypt::OpenToken> to encrypt payloads using |
|
34
|
|
|
|
|
|
|
DES3 encryption. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=over |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item keysize() |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Returns the key size used for DES3 encryption; 24 bytes. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item iv_len() |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Returns the length of the Initialization Vector needed for DES3 encryption; 8 |
|
47
|
|
|
|
|
|
|
bytes. |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item cipher($key, $iv) |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns a C<Crypt::CBC> compatible cipher the implements the DES3 encryption. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Graham TerMarsch (cpan@howlingfrog.com) |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under |
|
62
|
|
|
|
|
|
|
the Artistic-2.0 license. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
L<Crypt::OpenToken::Cipher> |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |