All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.modes.EncryptMode

java.lang.Object
   |
   +----is.logi.crypto.Crypto
           |
           +----is.logi.crypto.modes.EncryptMode

public abstract class EncryptMode
extends Crypto
Descendants of EncryptMode encrypt arbtrarily large arrays of plaintext. A corresponding DecryptMode should be used for decryption.

Most EncryptModes use a CipherKey object to do actual encryption and do additional computations to mask repetitions in the plaintext.

Author:
Logi Ragnarsson (logir@hi.is)
See Also:
DecryptMode

Constructor Index

 o EncryptMode()

Method Index

 o encrypt(byte[], int, int)
Send bytes to the EncryptMode for encryption.
 o flush()
Padds the internal buffer, encrypts it and returns the ciphertext.
 o flush(byte[], int, int)
Equivalent to calling encrypt(source,i,length) followed by flush().
 o getKey()
Return the key used for encryption.
 o setKey(CipherKey)
Set the key to use for encryption.

Constructors

 o EncryptMode
 public EncryptMode()

Methods

 o getKey
 public abstract CipherKey getKey()
Return the key used for encryption.

 o setKey
 public abstract void setKey(CipherKey key)
Set the key to use for encryption. Do not call this method when there may be data in the internal buffer.

 o flush
 public abstract byte[] flush()
Padds the internal buffer, encrypts it and returns the ciphertext.

 o flush
 public byte[] flush(byte source[],
                     int i,
                     int length)
Equivalent to calling encrypt(source,i,length) followed by flush().

 o encrypt
 public abstract byte[] encrypt(byte source[],
                                int i,
                                int length)
Send bytes to the EncryptMode for encryption.

Encrypt length bytes from source, starting at i and return the ciphertext. Data may be encrypted in blocks in which case only whole blocks of ciphertext are written to dest. Any remaining plaintext will be stored and prepended to source in the next call to encrypt.


All Packages  Class Hierarchy  This Package  Previous  Next  Index