Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Crypt::Twofish2 1.01

    Download button

    No screenshots available
    Downloads: 362  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Marc Lehmann | More programs
    Perl Artistic License / FREE
    August 29th, 2008, 09:25 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Crypt::Twofish2 description

    Crypt::CBC compliant Twofish encryption module

    Crypt::Twofish2 is a 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);


    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 actually 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 somewhat 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 internal 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/decryption 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.

    Requirements:

    · Perl

      


    TAGS:

    Crypt::CBC class | Twofish encryption | Perl module | Crypt::CBC | Twofish | encryption

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM