OpenToken/Cipher/AES128.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 26 / 26 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« OpenToken/Cipher.pm ↑ Summary OpenToken/Cipher/AES256.pm »
1 package Crypt::OpenToken::Cipher::AES128;
2  
3 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Crypt::Rijndael;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 with 'Crypt::OpenToken::Cipher';
8  
9 7 ▶sub keysize { 16 }
Subroutine keysize: called CC=1 SCAR=0.0
Pod documented
10 9 ▶sub iv_len { 16 }
Subroutine iv_len: called CC=1 SCAR=0.0
Pod documented
11 9 ▶sub cipher {
Subroutine cipher: called CC=1 SCAR=0.0
Pod documented
12 9 my ($self, $key, $iv) = @_;
13 9 my $crypto = Crypt::Rijndael->new($key, Crypt::Rijndael::MODE_CBC());
14 9 $crypto->set_iv($iv);
15 9 return $crypto;
16 }
17  
18 2 1;
19  
20 =head1 NAME
21  
22 Crypt::OpenToken::Cipher::AES128 - AES128 encryption support for OpenToken
23  
24 =head1 DESCRIPTION
25  
26 This library can be used by C<Crypt::OpenToken> to encrypt payloads using
27 AES-128 encryption.
28  
29 =head1 METHODS
30  
31 =over
32  
33 =item keysize()
34  
35 Returns the key size used for AES-128 encryption; 16 bytes.
36  
37 =item iv_len()
38  
39 Returns the length of the Initialization Vector needed for AES-128 encryption;
40 16 bytes.
41  
42 =item cipher($key, $iv)
43  
44 Returns a C<Crypt::CBC> compatible cipher the implements the AES-128
45 encryption.
46  
47 =back
48  
49 =head1 AUTHOR
50  
51 Graham TerMarsch (cpan@howlingfrog.com)
52  
53 =head1 COPYRIGHT & LICENSE
54  
55 C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under
56 the Artistic-2.0 license.
57  
58 =head1 SEE ALSO
59  
60 L<Crypt::OpenToken::Cipher>
61  
62 =cut
« OpenToken/Cipher.pm ↑ Summary OpenToken/Cipher/AES256.pm »