is.logi.crypto.modes
Class DecryptMode

java.lang.Object
  |
  +--is.logi.crypto.Crypto
        |
        +--is.logi.crypto.modes.DecryptMode
Direct Known Subclasses:
DecryptCBC, DecryptCFB, DecryptECB, DecryptOFB

public abstract class DecryptMode
extends Crypto

DecryptMode objects are used to decrypt ciphertext generated with a correpsonding EncryptMode object. They must in most cases be initialized with the appropriate key.

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

Fields inherited from class is.logi.crypto.Crypto
BIT, cdsPath, keySource, NIBBLE, primeCertainty, random
 
Constructor Summary
DecryptMode()
           
 
Method Summary
abstract  byte[] decrypt(byte[] source, int i, int length)
          Send bytes to the DecryptMode for decryption.
abstract  CipherKey getKey()
          Return the key used for decryption.
abstract  void setKey(CipherKey key)
          Set the key to use for decryption.
 
Methods inherited from class is.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecryptMode

public DecryptMode()
Method Detail

getKey

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

setKey

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

decrypt

public abstract byte[] decrypt(byte[] source,
                               int i,
                               int length)
Send bytes to the DecryptMode for decryption.

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



Copyright 1997-1999 Logi Ragnarsson