All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.modes.DecryptOFB

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

public class DecryptOFB
extends DecryptMode
Use this class to decrypt ciphertext generated by EncryptOFB.

Note that unlike ECB or CBC mode, OFB mode uses teh same key to encrypt and decrypt, even with asymmetric ciphers.

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

Constructor Index

 o DecryptOFB(CipherKey, int)
Create a new OFB-mode decrypt session with the specified key.
 o DecryptOFB(int)
Create a new OFB-mode decrypt session with no key.

Method Index

 o decrypt(byte[], int, int)
Send bytes to the DecryptCFB object for encryption.
 o flush()
Padds the internal buffer, encrypts it and returns the ciphertext.
 o getKey()
Return the key used for encryption.
 o setKey(CipherKey)
Set the key to use for encryption.

Constructors

 o DecryptOFB
 public DecryptOFB(CipherKey key,
                   int bufSize)
Create a new OFB-mode decrypt session with the specified key. A buffer of bufSize bytes is created to hold a pre-calculated xor-stream.

 o DecryptOFB
 public DecryptOFB(int bufSize)
Create a new OFB-mode decrypt session with no key. No encryption can be performed until the setKey() method has been called.

A buffer of bufSize bytes is created to hold a pre-calculated xor-stream.

Methods

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

Overrides:
getKey in class DecryptMode
 o setKey
 public void setKey(CipherKey key)
Set the key to use for encryption.

Overrides:
setKey in class DecryptMode
 o flush
 public synchronized byte[] flush()
Padds the internal buffer, encrypts it and returns the ciphertext. Since CBF mode doesn't use an internal buffer, an empty array is returned.

 o decrypt
 public synchronized byte[] decrypt(byte source[],
                                    int i,
                                    int length)
Send bytes to the DecryptCFB object for encryption.

Decrypt length bytes from source, starting at i and return the plaintext.

Overrides:
decrypt in class DecryptMode

All Packages  Class Hierarchy  This Package  Previous  Next  Index