Sha256: 41e55e6ad876fe1bc503d1ccad4812954027883ad3c4cc0d2a28c7c412342841

Contents?: true

Size: 917 Bytes

Versions: 1

Compression:

Stored size: 917 Bytes

Contents

module Net; module SSH; module Transport

  # A cipher that does nothing but pass the data through, unchanged. This
  # keeps things in the code nice and clean when a cipher has not yet been
  # determined (i.e., during key exchange).
  class IdentityCipher
    class <<self
      # A default block size of 8 is required by the SSH2 protocol.
      def block_size
        8
      end

      # Returns an arbitrary integer.
      def iv_len
        4
      end

      # Does nothing. Returns self.
      def encrypt
        self
      end

      # Does nothing. Returns self.
      def decrypt
        self
      end

      # Passes its single argument through unchanged.
      def update(text)
        text
      end

      # Returns the empty string.
      def final
        ""
      end

      # The name of this cipher, which is "identity".
      def name
        "identity"
      end
    end
  end

end; end; end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
net-ssh-2.0.4 lib/net/ssh/transport/identity_cipher.rb