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::S2K (3)

.ds Aq ’

NAME

Crypt::OpenPGP::S2k - String-to-key generation

CONTENTS

SYNOPSIS



    use Crypt::OpenPGP::S2k;

    # S2k generates an encryption key from a passphrase; in order to
    # understand how large of a key to generate, we need to know which
    # cipher were using, and what the passphrase is.
    my $cipher = Crypt::OpenPGP::Cipher->new( ... );
    my $passphrase = foo;

    my $s2k = Crypt::OpenPGP::S2k->new( Salt_Iter );
    my $key = $s2k->generate( $passphrase, $cipher->keysize );

    my $serialized = $s2k->save;



DESCRIPTION

Crypt::OpenPGP::S2k implements string-to-key generation for use in generating symmetric cipher keys from standard, arbitrary-length passphrases (like those used to lock secret key files). Since a passphrase can be of any length, and key material must be a very specific length, a method is needed to translate the passphrase into the key. The OpenPGP RFC defines three such methods, each of which this class implements.

USAGE

    Crypt::OpenPGP::S2k->new($type)

Creates a new type of S2k-generator of type $type; valid values for $type are Simple, Salted, and Salt_Iter. These generator types are described in the OpenPGP RFC section 3.6.

Returns the new S2k-generator object.

    Crypt::OpenPGP::S2k->parse($buffer)

Given a buffer $buffer of type Crypt::OpenPGP::Buffer, determines the type of S2k from the first octet in the buffer (one of the types listed above in new), then creates a new object of that type and initializes the S2k state from the buffer $buffer. Different initializations occur based on the type of S2k.

Returns the new S2k-generator object.

CW$s2k->save

Serializes the S2k object and returns the serialized form; this form will differ based on the type of S2k.

CW$s2k->generate($passphrase, CW$keysize)

Given a passphrase $passphrase, which should be a string of octets of arbitrary length, and a keysize $keysize, generates enough key material to meet the size $keysize, and returns that key material.

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::S2K (3) 2009-12-10

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