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
Net::SSH::Perl::Cipher(3) User Contributed Perl Documentation Net::SSH::Perl::Cipher(3)

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

    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);

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.

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";
    }

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.

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.

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.

Encrypts $text and returns the encrypted string.

Decrypts $text and returns the decrypted string.

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

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

  • $cipher->encrypt($text)

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

  • $cipher->decrypt($text)

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

Please see the Net::SSH::Perl manpage for author, copyright, and license information.
2017-08-24 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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