Crypt::Twofish2 man page on OpenServer

Man page or keyword search:  
man Server   5388 pages
apropos Keyword Search (all sections)
Output format
OpenServer logo
[printable version]

Twofish2(3)	      User Contributed Perl Documentation	   Twofish2(3)

NAME
       Crypt::Twofish2 - Crypt::CBC compliant Twofish encryption module

SYNOPSIS
	use Crypt::Twofish2;

	# keysize() is 32, but 24 and 16 are also possible
	# blocksize() is 16

	$cipher = new Crypt::Twofish2 "a" x 32, Crypt::Twofish2::MODE_CBC;

	$crypted = $cipher->encrypt($plaintext);
	# - OR -
	$plaintext = $cipher->decrypt($crypted);

DESCRIPTION
       This module implements the twofish cipher in a less braindamaged (read:
       slow and ugly) way than the existing "Crypt::Twofish" module.

       Although it is "Crypt::CBC" compliant you usually gain nothing by using
       that module (except generality, which is often a good thing), since
       "Crypt::Twofish2" can work in either ECB or CBC mode itself.

       keysize
	   Returns the keysize, which is 32 (bytes). The Twofish2 cipher actu-
	   ally supports keylengths of 16, 24 or 32 bytes, but there is no way
	   to communicate this to "Crypt::CBC".

       blocksize
	   The blocksize for Twofish2 is 16 bytes (128 bits), which is some-
	   what unique. It is also the reason I need this module myself ;)

       $cipher = new $key [, $mode]
	   Create a new "Crypt::Twofish2" cipher object with the given key
	   (which must be 128, 192 or 256 bits long). The additional $mode
	   argument is the encryption mode, either "MODE_ECB" (electronic
	   cookbook mode, the default), "MODE_CBC" (cipher block chaining, the
	   same that "Crypt::CBC" does) or "MODE_CFB1" (1-bit cipher feedback
	   mode).

	   ECB mode is very insecure (read a book on cryptography if you don't
	   know why!), so you should probably use CBC mode. CFB1 mode is not
	   tested and is most probably broken, so do not try to use it.

	   In ECB mode you can use the same cipher object to encrypt and
	   decrypt data. However, every change of "direction" causes an inter-
	   nal reordering of key data, which is quite slow, so if you want ECB
	   mode and encryption/decryption at the same time you should create
	   two seperate "Crypt::Twofish2" objects with the same key.

	   In CBC mode you have to use seperate objects for encryption/decryp-
	   tion in any case.

	   The "MODE_*"-constants are not exported by this module, so you must
	   specify them as "Crypt::Twofish2::MODE_CBC" etc. (sorry for that).

       $cipher->encrypt($data)
	   Encrypt data. The size of $data must be a multiple of "blocksize"
	   (16 bytes), otherwise this function will croak. Apart from that, it
	   can be of (almost) any length.

       $cipher->decrypt($data)
	   The pendant to "encrypt" in that it decrypts data again.

SEE ALSO
       Crypt::CBC, Crypt::Twofish.

BUGS
       Should EXPORT or EXPORT_OK the MODE constants.

       There should be a way to access initial IV contents :(

       Although I tried to make the original twofish code portable, I can't
       say how much I did succeed. The code tries to be portable itself, and I
       hope I got the endianness issues right. The code is also copyright
       Counterpane Systems, no license accompanied it, so using it might actu-
       ally be illegal ;)

       I also cannot guarantee for security, but the module is used quite a
       bit, so there are no obvious bugs left.

AUTHOR
	Marc Lehmann <schmorp@schmorp.de>
	http://home.schmorp.de/

	The actual twofish encryption is written in horribly microsoft'ish looking
	almost ansi-c by Doug Whiting.

perl v5.8.8			  2005-03-03			   Twofish2(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OpenServer

List of man pages available for OpenServer

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net