| 1 | package Crypt::OpenToken::Cipher; | ||
| 2 | |||
| 3 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | requires 'keysize'; | |
| 7 | 4 | requires 'iv_len'; | |
| 8 | 4 | requires 'cipher'; | |
| 9 | |||
| 10 | 4 | 1; | |
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | Crypt::OpenToken::Cipher - Interface for OpenToken Ciphers | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | This module defines an interface for ciphers. | ||
| 19 | |||
| 20 | =head1 METHODS | ||
| 21 | |||
| 22 | =over | ||
| 23 | |||
| 24 | =item keysize() | ||
| 25 | |||
| 26 | Returns the key sized used for encryption, in bytes. | ||
| 27 | |||
| 28 | =item iv_len() | ||
| 29 | |||
| 30 | Returns the length of the Initialization Vector needed for encryption, in | ||
| 31 | bytes. | ||
| 32 | |||
| 33 | =item cipher($key, $iv) | ||
| 34 | |||
| 35 | Returns a C<Crypt::CBC> compatible cipher object which implements the | ||
| 36 | encryption. | ||
| 37 | |||
| 38 | =back | ||
| 39 | |||
| 40 | =head1 AUTHOR | ||
| 41 | |||
| 42 | Graham TerMarsch (cpan@howlingfrog.com) | ||
| 43 | |||
| 44 | =head1 COPYRIGHT & LICENSE | ||
| 45 | |||
| 46 | C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under | ||
| 47 | the Artistic-2.0 license. | ||
| 48 | |||
| 49 | =head1 SEE ALSO | ||
| 50 | |||
| 51 | L<Crypt::OpenToken::Cipher::AES128> | ||
| 52 | L<Crypt::OpenToken::Cipher::AES256> | ||
| 53 | L<Crypt::OpenToken::Cipher::DES3> | ||
| 54 | L<Crypt::OpenToken::Cipher::NULL> | ||
| 55 | |||
| 56 | =cut | ||