.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Rijndael 3pm" .TH Rijndael 3pm "2018-11-01" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Crypt::Rijndael \- Crypt::CBC compliant Rijndael encryption module .SH "VERSION" .IX Header "VERSION" Version 1.13 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Crypt::Rijndael; \& \& # keysize() is 32, but 24 and 16 are also possible \& # blocksize() is 16 \& \& $cipher = Crypt::Rijndael\->new( "a" x 32, Crypt::Rijndael::MODE_CBC() ); \& \& $cipher\->set_iv($iv); \& $crypted = $cipher\->encrypt($plaintext); \& # \- OR \- \& $plaintext = $cipher\->decrypt($crypted); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements the Rijndael cipher, which has just been selected as the Advanced Encryption Standard. .IP "keysize" 4 .IX Item "keysize" Returns the keysize, which is 32 (bytes). The Rijndael cipher actually supports keylengths of 16, 24 or 32 bytes, but there is no way to communicate this to \f(CW\*(C`Crypt::CBC\*(C'\fR. .IP "blocksize" 4 .IX Item "blocksize" The blocksize for Rijndael is 16 bytes (128 bits), although the algorithm actually supports any blocksize that is any multiple of our bytes. 128 bits, is however, the AES-specified block size, so this is all we support. .ie n .IP "$cipher = Crypt::Rijndael\->new( $key [, $mode] )" 4 .el .IP "\f(CW$cipher\fR = Crypt::Rijndael\->new( \f(CW$key\fR [, \f(CW$mode\fR] )" 4 .IX Item "$cipher = Crypt::Rijndael->new( $key [, $mode] )" Create a new \f(CW\*(C`Crypt::Rijndael\*(C'\fR cipher object with the given key (which must be 128, 192 or 256 bits long). The additional \f(CW$mode\fR argument is the encryption mode, either \f(CW\*(C`MODE_ECB\*(C'\fR (electronic codebook mode, the default), \f(CW\*(C`MODE_CBC\*(C'\fR (cipher block chaining, the same that \f(CW\*(C`Crypt::CBC\*(C'\fR does), \f(CW\*(C`MODE_CFB\*(C'\fR (128\-bit cipher feedback), \&\f(CW\*(C`MODE_OFB\*(C'\fR (128\-bit output feedback), or \f(CW\*(C`MODE_CTR\*(C'\fR (counter mode). .Sp \&\s-1ECB\s0 mode is very insecure (read a book on cryptography if you don't know why!), so you should probably use \s-1CBC\s0 mode. .ie n .IP "$cipher\->set_iv($iv)" 4 .el .IP "\f(CW$cipher\fR\->set_iv($iv)" 4 .IX Item "$cipher->set_iv($iv)" This allows you to change the initial value vector used by the chaining modes. It is not relevant for \s-1ECB\s0 mode. .ie n .IP "$cipher\->encrypt($data)" 4 .el .IP "\f(CW$cipher\fR\->encrypt($data)" 4 .IX Item "$cipher->encrypt($data)" Encrypt data. The size of \f(CW$data\fR must be a multiple of \f(CW\*(C`blocksize\*(C'\fR (16 bytes), otherwise this function will croak. Apart from that, it can be of (almost) any length. .ie n .IP "$cipher\->decrypt($data)" 4 .el .IP "\f(CW$cipher\fR\->decrypt($data)" 4 .IX Item "$cipher->decrypt($data)" Decrypts \f(CW$data\fR. .SS "Encryption modes" .IX Subsection "Encryption modes" Use these constants to select the cipher type: .IP "\s-1MODE_CBC\s0 \- Cipher Block Chaining" 4 .IX Item "MODE_CBC - Cipher Block Chaining" .PD 0 .IP "\s-1MODE_CFB\s0 \- Cipher feedback" 4 .IX Item "MODE_CFB - Cipher feedback" .IP "\s-1MODE_CTR\s0 \- Counter mode" 4 .IX Item "MODE_CTR - Counter mode" .IP "\s-1MODE_ECB\s0 \- Electronic cookbook mode" 4 .IX Item "MODE_ECB - Electronic cookbook mode" .IP "\s-1MODE_OFB\s0 \- Output feedback" 4 .IX Item "MODE_OFB - Output feedback" .IP "\s-1MODE_PCBC\s0 \- ignore this one for now :)" 4 .IX Item "MODE_PCBC - ignore this one for now :)" .PD .SH "SEE ALSO" .IX Header "SEE ALSO" Crypt::CBC, http://www.csrc.nist.gov/encryption/aes/ .SH "BUGS" .IX Header "BUGS" Should \s-1EXPORT\s0 or \s-1EXPORT_OK\s0 the \s-1MODE\s0 constants. .SH "AUTHOR" .IX Header "AUTHOR" Currently maintained by Leon Timmermans \f(CW\*(C`leont@cpan.org\*(C'\fR. .PP Previously maintained by brian d foy, \f(CW\*(C`\*(C'\fR. .PP Original code by Rafael R. Sevilla. .PP The Rijndael Algorithm was developed by Vincent Rijmen and Joan Daemen, and has been selected as the \s-1US\s0 Government's Advanced Encryption Standard. .SH "SOURCE" .IX Header "SOURCE" This code is in Github: .PP .Vb 1 \& git://github.com/leont/crypt\-rijndael.git .Ve .SH "LICENSE" .IX Header "LICENSE" This software is licensed under the Lesser \s-1GNU\s0 Public License v3 (29 June 2007). See the included \s-1COPYING\s0 file for details.