# Cipher (sshj 0.5.0 API)
Date: 2011-07-27

## net.schmizz.sshj.transport.cipher
Interface Cipher

All Known Implementing Classes:
  AES128CBC, AES128CTR, AES192CBC, AES192CTR, AES256CBC, AES256CTR, BaseCipher, BlowfishCBC, NoneCipher, TripleDESCBC

    public interface Cipher

Wrapper for a cryptographic cipher, used either for encryption or decryption.

Nested Class Summary
`static class` `Cipher.Mode`

Method Summary
`int` `getBlockSize()`
`int` `getIVSize()`
`void` `init(Cipher.Mode mode, byte[] key, byte[] iv)` Initialize the cipher for encryption or decryption with the given private key and initialization vector
`void` `update(byte[] input, int inputOffset, int inputLen)` Performs in-place encryption or decryption on the given data.

Method Detail

### getBlockSize

    int getBlockSize()

  Returns:
    the block size for this cipher

### getIVSize

    int getIVSize()

  Returns:
    the size of the initialization vector

### init

    void init(Cipher.Mode mode,
              byte[] key,
              byte[] iv)

  Initialize the cipher for encryption or decryption with the given private key and initialization vector

  Parameters:
    `mode` - whether this instance wil encrypt or decrypt
    `key` - the key for the cipher
    `iv` - initialization vector

### update

    void update(byte[] input,
                int inputOffset,
                int inputLen)

  Performs in-place encryption or decryption on the given data.

  Parameters:
    `input` - the subject
    `inputOffset` - offset at which to start
    `inputLen` - number of bytes starting at `inputOffset`

Copyright © 2009-2011. All Rights Reserved.