NAME

Crypt::XXTEA_XS - Implementation of Corrected Block Tiny Encryption Algorithm

VERSION

version 0.0101

SYNOPSIS

   use Crypt::XXTEA_XS;
   use Crypt::CBC;

   my $xxtea = Crypt::XXTEA_XS->new( $key );
   my $cbc = Crypt::CBC->new( -cipher => $xxtea );

   my $text = 'The quick brown fox jumps over the lazy dog.';
   my $cipher_text = $cbc->encrypt( $text );

   my $plain_text = $cbc->decrypt( $cipher_text );

DESCRIPTION

In cryptography, Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. The cipher's designers were Roger Needham and David Wheeler of the Cambridge Computer Laboratory, and the algorithm was presented in an unpublished technical report in October 1998 (Wheeler and Needham, 1998). It is not subject to any patents.

Formally speaking, XXTEA is a consistent incomplete source-heavy heterogeneous UFN (unbalanced Feistel network) block cipher. XXTEA operates on variable-length blocks that are some arbitrary multiple of 32 bits in size (minimum 64 bits). The number of full cycles depends on the block size, but there are at least six (rising to 32 for small block sizes).

This module implements XXTEA encryption. It supports the Crypt::CBC interface, with the following functions.

METHODS

keysize

Returns the maximum XXTEA key size, 16 bytes.

blocksize

Returns the XXTEA block size, which is 8 bytes. This function exists so that Crypt::XXTEA_XS can work with Crypt::CBC.

new

    my $xxtea = Crypt::XXTEA_XS->new( $key );

This creates a new Crypt::XXTEA_XS object with the specified key.

encrypt

    $cipher_text = $xxtea->encrypt($plain_text);

Encrypts blocksize() bytes of $plain_text and returns the corresponding ciphertext.

decrypt

    $plain_text = $xxtea->decrypt($cipher_text);

Decrypts blocksize() bytes of $cipher_text and returns the corresponding plaintext.

SEE ALSO

Crypt::CBC

Crypt::XXTEA_PP

AUTHOR

Kars Wang <jahiy@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Kars Wang.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.