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