Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

crypt::des(3) [suse man page]

DES(3)							User Contributed Perl Documentation						    DES(3)

NAME
Crypt::DES - Perl DES encryption module SYNOPSIS
use Crypt::DES; DESCRIPTION
The module implements the Crypt::CBC interface, which has the following methods blocksize =item keysize =item encrypt =item decrypt FUNCTIONS
blocksize Returns the size (in bytes) of the block cipher. keysize Returns the size (in bytes) of the key. Optimal size is 8 bytes. new my $cipher = new Crypt::DES $key; This creates a new Crypt::DES BlockCipher object, using $key, where $key is a key of "keysize()" bytes. encrypt my $cipher = new Crypt::DES $key; my $ciphertext = $cipher->encrypt($plaintext); This function encrypts $plaintext and returns the $ciphertext where $plaintext and $ciphertext should be of "blocksize()" bytes. decrypt my $cipher = new Crypt::DES $key; my $plaintext = $cipher->decrypt($ciphertext); This function decrypts $ciphertext and returns the $plaintext where $plaintext and $ciphertext should be of "blocksize()" bytes. EXAMPLE
my $key = pack("H16", "0123456789ABCDEF"); my $cipher = new Crypt::DES $key; my $ciphertext = $cipher->encrypt("plaintex"); # NB - 8 bytes print unpack("H16", $ciphertext), " "; NOTES
Do note that DES only uses 8 byte keys and only works on 8 byte data blocks. If you're intending to encrypt larger blocks or entire files, please use Crypt::CBC in conjunction with this module. See the Crypt::CBC documentation for proper syntax and use. Also note that the DES algorithm is, by today's standard, weak encryption. Crypt::Blowfish is highly recommended if you're interested in using strong encryption and a faster algorithm. SEE ALSO
Crypt::Blowfish Crypt::IDEA Bruce Schneier, Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc. COPYRIGHT
The implementation of the DES algorithm was developed by, and is copyright of, Eric Young (eay@mincom.oz.au). Other parts of the perl extension and module are copyright of Systemics Ltd ( http://www.systemics.com/ ). Cross-platform work and packaging for single algorithm distribution is copyright of W3Works, LLC. MAINTAINER
This single-algorithm package and cross-platform code is maintained by Dave Paris <amused@pobox.com>. perl v5.12.1 2005-12-08 DES(3)

Check Out this Related Man Page

Twofish(3pm)						User Contributed Perl Documentation					      Twofish(3pm)

NAME
Crypt::Twofish - The Twofish Encryption Algorithm SYNOPSIS
use Crypt::Twofish; $cipher = Crypt::Twofish->new($key); $ciphertext = $cipher->encrypt($plaintext); $plaintext = $cipher->decrypt($ciphertext); DESCRIPTION
Twofish is a 128-bit symmetric block cipher with a variable length (128, 192, or 256-bit) key, developed by Counterpane Labs. It is unpatented and free for all uses, as described at <URL:http://www.counterpane.com/twofish.html>. This module implements Twofish encryption. It supports the Crypt::CBC interface, with the functions described below. It also provides an interface that is call-compatible with Crypt::Twofish 1.0, but its use in new code is strongly discouraged. Functions blocksize Returns the size (in bytes) of the block (16, in this case). keysize Returns the size (in bytes) of the key. Although the module understands 128, 192, and 256-bit keys, it returns 16 for compatibility with Crypt::CBC. new($key) This creates a new Crypt::Twofish object with the specified key (which should be 16, 24, or 32 bytes long). encrypt($data) Encrypts blocksize() bytes of $data and returns the corresponding ciphertext. decrypt($data) Decrypts blocksize() bytes of $data and returns the corresponding plaintext. SEE ALSO
Crypt::CBC, Crypt::Blowfish, Crypt::TEA ACKNOWLEDGEMENTS
Nishant Kakani For writing Crypt::Twofish 1.0 (this version is a complete rewrite). Tony Cook For making the module work under Activeperl, testing on several platforms, and suggesting that I probe for features via %Config. AUTHOR
Abhijit Menon-Sen <ams@wiw.org> Copyright 2001 Abhijit Menon-Sen. All rights reserved. This software is distributed under the terms of the Artistic License <URL:http://ams.wiw.org/code/artistic.txt>. perl v5.14.2 2001-05-21 Twofish(3pm)
Man Page