Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

crypt::simple(3pm) [debian man page]

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

NAME
Crypt::Simple - encrypt stuff simply SYNOPSIS
use Crypt::Simple; my $data = encrypt(@stuff); my @same_stuff = decrypt($data); DESCRIPTION
Maybe you have a web application and you need to store some session data at the client side (in a cookie or hidden form fields) but you don't want the user to be able to mess with the data. Maybe you want to save secret information to a text file. Maybe you have better ideas of what to do with encrypted stuff! This little module will convert all your data into nice base64 text that you can save in a text file, send in an email, store in a cookie or web page, or bounce around the Net. The data you encrypt can be as simple or as complicated as you like. KEY
If you don't pass any options when using "Crypt::Simple" we will generate a key for you based on the name of your module that uses this one. In many cases this works fine, but you may want more control over the key. Here's how: use Crypt::Simple passphrase => 'pass phrase'; The MD5 hash of the text string "pass phrase" is used as the key. use Crypt::Simple prompt => 'Please type the magic words'; The user is prompted to enter a passphrase, and the MD5 hash of the entered text is used as the key. use Crypt::Simple passfile => '/home/marty/secret'; The contents of the file /home/marty/secret are used as the pass phrase: the MD5 hash of the file is used as the key. use Crypt::Simple file => '/home/marty/noise'; The contents of the file /home/marty/noise are directly used as the key. INTERNALS
"Crypt::Simple" is really just a wrapper round a few other useful Perl modules: you may want to read the documentation for these modules too. We use "FreezeThaw" to squish all your data into a concise textual representation. We use "Compress::Zlib" to compress this string, and then use "Crypt::Blowfish" in a home-brew CBC mode to perform the encryption. Somewhere in this process we also add a MD5 digest (using "Digest::MD5"). Then we throw the whole thing through "MIME::Base64" to produce a nice bit of text for you to play with. Decryption, obviously, is the reverse of this process. WARNING
Governments throughout the world do not like encryption because it makes it difficult for them to look at all your stuff. Each country has a different policy designed to stop you using encryption: some governments are honest enough to make it illegal; some think it is a dangerous weapon; some insist that you are free to encrypt, but only evil people would want to; some make confusing and contradictory laws because they try to do all of the above. Although this modules itself does not include any encryption code, it does use another module that contains encryption code, and this documentation mentions encryption. Downloading, using, or reading this modules could be illegal where you live. AUTHOR
Marty Pauley <marty@kasei.com> COPYRIGHT
Copyright (C) 2001 Kasei Limited This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. perl v5.10.0 2002-09-23 Simple(3pm)

Check Out this Related Man Page

Crypt::DES_EDE3(3pm)					User Contributed Perl Documentation				      Crypt::DES_EDE3(3pm)

NAME
Crypt::DES_EDE3 - Triple-DES EDE encryption/decryption SYNOPSIS
use Crypt::DES_EDE3; my $ede3 = Crypt::DES_EDE3->new($key); $ede3->encrypt($block); DESCRIPTION
Crypt::DES_EDE3 implements DES-EDE3 encryption. This is triple-DES encryption where an encrypt operation is encrypt-decrypt-encrypt, and decrypt is decrypt-encrypt-decrypt. This implementation uses Crypt::DES to do its dirty DES work, and simply provides a wrapper around that module: setting up the individual DES ciphers, initializing the keys, and performing the encryption/decryption steps. DES-EDE3 encryption requires a key size of 24 bytes. You're probably best off not using this module directly, as the encrypt and decrypt methods expect 8-octet blocks. You might want to use the module in conjunction with Crypt::CBC, for example. This would be DES-EDE3-CBC, or triple-DES in outer CBC mode. USAGE
$ede3 = Crypt::DES_EDE3->new($key) Creates a new Crypt::DES_EDE3 object (really, a collection of three DES ciphers), and initializes each cipher with part of $key, which should be at least 24 bytes. If it's longer than 24 bytes, the extra bytes will be ignored. Returns the new object. $ede3->encrypt($block) Encrypts an 8-byte block of data $block using the three DES ciphers in an encrypt-decrypt-encrypt operation. Returns the encrypted block. $ede3->decrypt($block) Decrypts an 8-byte block of data $block using the three DES ciphers in a decrypt-encrypt-decrypt operation. Returns the decrypted block. $ede3->blocksize Returns the block size(8). $ede3->keysize Returns the key size(24). LICENSE
Crypt::DES_EDE3 is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR &; COPYRIGHTS Crypt::DES_EDE3 is Copyright 2001 Benjamin Trott, ben@rhumba.pair.com. All rights reserved. perl v5.8.8 2001-09-15 Crypt::DES_EDE3(3pm)
Man Page