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  -  NET::SSH::PERL::CIPHER (3)

.ds Aq ’

NAME

Net::SSH::Perl::Cipher - Base cipher class, plus utility methods

CONTENTS

SYNOPSIS



    use Net::SSH::Perl::Cipher;

    # Get list of supported cipher IDs.
    my $supported = Net::SSH::Perl::Cipher::supported();

    # Translate a cipher name into an ID.
    my $id = Net::SSH::Perl::Cipher::id($name);

    # Translate a cipher ID into a name.
    my $name = Net::SSH::Perl::Cipher::name($id);



DESCRIPTION

Net::SSH::Perl::Cipher provides a base class for each of the encryption cipher classes. In addition, it defines a set of utility methods that can be called either as functions or object methods.

UTILITY METHODS

supported( [ protocol => CW$protocol, ] [ CW$ciph_id [, CW$server_supports ] ])

Without arguments returns a reference to an array of ciphers supported by Net::SSH::Perl. These are ciphers that have working Net::SSH::Perl::Cipher:: implementations, essentially. Pass ’protocol => 2’ to get a list of SSH2 ciphers.

With one argument $ciph_id, returns a true value if that cipher is supported by Net::SSH::Perl, and false otherwise.

With two arguments, $ciph_id and $server_supports, returns true if the cipher represented by $ciph_id is supported both by Net::SSH::Perl and by the sshd server. The list of ciphers supported by the server should be in $server_supports, a bit mask sent from the server during the session identification phase.

Can be called either as a non-exported function, i.e.



    my $i_support = Net::SSH::Perl::Cipher::supported();



or as an object method of a Net::SSH::Perl::Cipher object, or an object of a subclass:



    if ($ciph->supported($server_supports)) {
        print "Server supports cipher $ciph";
    }



id( [ CW$cipher_name ] )

Translates a cipher name into a cipher ID.

If given $cipher_name translates that name into the corresponding ID. If called as an object method, translates the object’s cipher class name into the ID.

name( [ CW$cipher_id ] )

Translates a cipher ID into a cipher name.

If given $cipher_id translates that ID into the corresponding name. If called as an object method, returns the (stripped) object’s cipher class name; for example, if the object were of type Net::SSH::Perl::Cipher::IDEA, name would return IDEA.

CIPHER USAGE

Net::SSH::Perl::Cipher->new($cipher_name, CW$key)

Instantiates a new cipher object of the type $cipher_name with the key $key; returns the cipher object, which will be blessed into the actual cipher subclass.

If $cipher_name is the special type ’None’ (no encryption cipher), the object will actually be blessed directly into the base class, and text to be encrypted and decrypted will be passed through without change.

CW$cipher->encrypt($text)

Encrypts $text and returns the encrypted string.

CW$cipher->decrypt($text)

Decrypts $text and returns the decrypted string.

CIPHER DEVELOPMENT

Classes implementing an encryption cipher must implement the following three methods:
o $class->new($key)

Given a key $key, should construct a new cipher object and bless it into $class, presumably.

o $cipher->encrypt($text)

Given plain text $text, should encrypt the text and return the encrypted string.

o $cipher->decrypt($text)

Given encrypted text $text, should decrypt the text and return the decrypted string.

AUTHOR & COPYRIGHTS

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


perl v5.20.3 NET::SSH::PERL::CIPHER (3) 2015-09-12

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