Tea.pm - The Tiny Encryption Algorithm in Perl and JavaScript
Usage:
use Crypt::Tea; $key = 'PUFgob$*LKDF D)(F IDD&P?/'; $ascii_ciphertext = &encrypt ($plaintext, $key); ... $plaintext_again = &decrypt ($ascii_ciphertext, $key); ... $signature = &asciidigest ($text);
In CGI scripts:
use Crypt::Tea; print &tea_in_javascript; # now the browser can encrypt # and decrypt ! see CGI::Htauth.pm for examples ...
This module implements TEA, the Tiny Encryption Algorithm, and some Modes of Use, in Perl and JavaScript.
The $key is a sufficiently longish string; at least 17 random 8-bit bytes for single encryption.
As of version 1.34, various Htauth-specific hook routines have now been moved out into the CGI::Htauth.pm module.
Version 1.43, #COMMENT#
(c) Peter J Billam 1998
Peter J Billam <peter@pjb.com.au>, with thanks also to Neil Watkiss for MakeMaker packaging.
Based on TEA, as described in http://www.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html , and on some help from Applied Cryptography by Bruce Schneier as regards the modes of use.
http://www.pjb.com.au/, CGI::Htauth.pm, perl(1).