All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.hi.logir.cryptonite.EncryptMode

java.lang.Object
   |
   +----is.hi.logir.cryptonite.Cryptonite
           |
           +----is.hi.logir.cryptonite.EncryptMode

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

Most EncryptModes take us 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)
Encrypt length bytes from source, starting at i and return the ciphertext.
 o flush()
Padds the internal buffer, encrypts it and returns the ciphertext.
 o flush(byte[], int, int)
This has the same effect as 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)
This has the same effect as calling encrypt(source,i,length) followed by flush().

 o encrypt
 public abstract byte[] encrypt(byte source[],
                                int i,
                                int length)
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 data will be stored and prepended to source in the next call to encrypt.


All Packages  Class Hierarchy  This Package  Previous  Next  Index