line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::OpenToken::Cipher::AES256; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
# Crypt::Rijndael will figure out whether its 128 or 256 bit mode depending on |
5
|
|
|
|
|
|
|
# the key we use, so leverage the implementation in C:OT:C:AES128 |
6
|
|
|
|
|
|
|
extends 'Crypt::OpenToken::Cipher::AES128'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
1
|
13
|
sub keysize { 32 } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
1; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Crypt::OpenToken::Cipher::AES256 - AES256 encryption support for OpenToken |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This library can be used by C<Crypt::OpenToken> to encrypt payloads using |
19
|
|
|
|
|
|
|
AES-256 encryption. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=over |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item keysize() |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Returns the key size used for AES-256 encryption; 32 bytes. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item iv_len() |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Returns the length of the Initialization Vector needed for AES-256 encryption; |
32
|
|
|
|
|
|
|
16 bytes. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item cipher($key, $iv) |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Returns a C<Crypt::CBC> compatible cipher the implements the AES-256 |
37
|
|
|
|
|
|
|
encryption. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=back |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 AUTHOR |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Graham TerMarsch (cpan@howlingfrog.com) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under |
48
|
|
|
|
|
|
|
the Artistic-2.0 license. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SEE ALSO |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
L<Crypt::OpenToken::Cipher> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |