Class Net::SSH::Transport::CipherFactory
In: lib/net/ssh/transport/cipher_factory.rb
Parent: Object

Implements a factory of OpenSSL cipher algorithms.

Methods

get   get_lengths   supported?  

Constants

SSH_TO_OSSL = { "3des-cbc" => "des-ede3-cbc", "blowfish-cbc" => "bf-cbc", "aes256-cbc" => "aes-256-cbc", "aes192-cbc" => "aes-192-cbc", "aes128-cbc" => "aes-128-cbc", "idea-cbc" => "idea-cbc", "cast128-cbc" => "cast-cbc", "rijndael-cbc@lysator.liu.se" => "aes-256-cbc", "arcfour128" => "rc4", "arcfour256" => "rc4", "arcfour512" => "rc4", "none" => "none"   Maps the SSH name of a cipher to it‘s corresponding OpenSSL name
KEY_LEN_OVERRIDE = { "arcfour256" => 32, "arcfour512" => 64   Ruby‘s OpenSSL bindings always return a key length of 16 for RC4 ciphers resulting in the error: OpenSSL::CipherError: key length too short. The following ciphers will override this key length.

Public Class methods

Retrieves a new instance of the named algorithm. The new instance will be initialized using an iv and key generated from the given iv, key, shared, hash and digester values. Additionally, the cipher will be put into encryption or decryption mode, based on the value of the encrypt parameter.

Returns a two-element array containing the [ key-length, block-size ] for the named cipher algorithm. If the cipher algorithm is unknown, or is "none", 0 is returned for both elements of the tuple.

Returns true if the underlying OpenSSL library supports the given cipher, and false otherwise.

[Validate]