GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CRYPT::OPENPGP::CIPHER (3)

.ds Aq ’

NAME

Crypt::OpenPGP::Cipher - PGP symmetric cipher factory

CONTENTS

SYNOPSIS



    use Crypt::OpenPGP::Cipher;

    my $alg = Rijndael;
    my $cipher = Crypt::OpenPGP::Cipher->new( $alg );

    my $plaintext = foo bar;
    my $ct = $cipher->encrypt($plaintext);
    my $pt = $cipher->decrypt($ct);



DESCRIPTION

Crypt::OpenPGP::Cipher is a factory class for PGP symmetric ciphers. All cipher objects are subclasses of this class and share a common interface; when creating a new cipher object, the object is blessed into the subclass to take on algorithm-specific functionality.

A Crypt::OpenPGP::Cipher object is a wrapper around a Crypt::OpenPGP::CFB object, which in turn wraps around the actual cipher implementation (eg. Crypt::Blowfish for a Blowfish cipher). This allows all ciphers to share a common interface and a simple instantiation method.

USAGE

    Crypt::OpenPGP::Cipher->new($cipher)

Creates a new symmetric cipher object of type $cipher; $cipher can be either the name of a cipher (in Crypt::OpenPGP parlance) or the numeric ID of the cipher (as defined in the OpenPGP RFC). Using a cipher name is recommended, for the simple reason that it is easier to understand quickly (not everyone knows the cipher IDs).

Valid cipher names are: IDEA, DES3, Blowfish, Rijndael, Rijndael192, Rijndael256, Twofish, and CAST5.

Returns the new cipher object on success. On failure returns undef; the caller should check for failure and call the class method errstr if a failure occurs. A typical reason this might happen is an unsupported cipher name or ID.

CW$cipher->encrypt($plaintext)

Encrypts the plaintext $plaintext and returns the encrypted text (ie. ciphertext). The encryption is done in CFB mode using the underlying cipher implementation.

CW$cipher->decrypt($ciphertext)

Decrypts the ciphertext $ciphertext and returns the plaintext. The decryption is done in CFB mode using the underlying cipher implementation.

CW$cipher->alg

Returns the name of the cipher algorithm (as listed above in new).

CW$cipher->alg_id

Returns the numeric ID of the cipher algorithm.

CW$cipher->blocksize

Returns the blocksize of the cipher algorithm (in bytes).

CW$cipher->keysize

Returns the keysize of the cipher algorithm (in bytes).

AUTHOR & COPYRIGHTS

Please see the Crypt::OpenPGP manpage for author, copyright, and license information.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CRYPT::OPENPGP::CIPHER (3) 2009-12-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.