Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Apache::AppSamurai::Session::Serialize::CryptBase64 1.01

    Download button

    No screenshots available
    Downloads: 454  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Paul M. Hirsch | More programs
    Perl Artistic License / FREE
    August 8th, 2008, 13:23 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Apache::AppSamurai::Session::Serialize::CryptBase64 description

    A storable, AES, and MIME::Base64 for session serializer.

    Apache::AppSamurai::Session::Serialize::CryptBase64 is a storable, AES, and MIME::Base64 for session serializer.

    SYNOPSIS

    use Apache::AppSamurai::Session::Serialize::CryptBase64;

    # You must choose a Crypt::CBC compatible cipher. (See the DESCRIPTION
    # section for the supported list.) This can be done either by
    # setting a specific value (the recommended way):
    $s->{args}->{SerializeCipher} = 'Crypt::OpenSSL::AES';

    # ... or by using the find_cipher() utility method:
    $s->{args}->{SerializeCipher} = Apache::AppSamurai::Session::Serialize::CryptBase64::find_cipher

    # serialize and unserialze take a single hash reference with required
    # subhashes. {args} must include two 256 bit hex string key/value pairs:
    # key = Session authentication key
    # ServerKey = Server key
    # (Examples keys are examples. Don't use them!
    $s->{args}->{ServerKey} = "628b49d96dcde97a430dd4f597705899e09a968f793491e4b704cae33a40dc02";
    $s->{args}->{key} = "c44474038d459e40e4714afefa7bf8dae9f9834b22f5e8ec1dd434ecb62b512e";

    # serialize() operates on the ->{data} subhash
    $s->{data}->{test} = "Testy!";
    $zipped = Apache::Session::Serialize::Base64::serialize($s);

    # unserialize works on the ->{serialized} subhash
    $s->{serialized} = $zipped;
    $data = Apache::Session::Serialize::Base64::unserialize($s);


    This module fulfils the serialization interface of Apache::Session and Apache::AppSamurai::Session. It serializes the data in the session object by use of Storable's nfreeze() function. Then, using the configured cipher module in {args}->{SerializeCipher}, the passed in {args}->{key}, (session authentication key), and the passed in {args}->{ServerKey}, (server key), it encrypts using the encrypt() method of Crypt::CBC. Finally, MIME::Base64 encode is used on the ciphertext for safe storage.

    The unserialize method uses a combination of MIME::Base64's decode_base64, Crypt::CBC's decrypt, and Storable's thaw methods to decode, decrypt, and reconstitute the data.

    The serialized data is ASCII text, suitable for storage in backing stores that don't handle binary data gracefully, such as Postgres. The following Crypt modules are currently supported:

    Crypt::Rijndael - AES implementation
    Crypt::OpenSSL::AES - OpenSSL AES wrapper
    Crypt::Twofish - Twofish implementation
    Crypt::Blowfish - Blowfish implementation


    The configured module must be installed before use. For efficiency, it is recommended that you staticly set the SerializeCipher argument when calling this module. That said, for convenience, a simple utility method, find_cipher() is provided.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Apache AppSamurai | serialize session | Perl module | Apache | AppSamurai | serialize

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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