All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.mode.OFB

java.lang.Object
   |
   +----java.security.IJCE_Traceable
           |
           +----java.security.Cipher
                   |
                   +----java.security.Mode
                           |
                           +----cryptix.provider.mode.FeedbackMode
                                   |
                                   +----cryptix.provider.mode.OFB

public class OFB
extends FeedbackMode
Implements a byte-oriented stream cipher using n-bit OFB with an n-bit-sized block cipher.

The full block size of the supplied cipher is used for the Output Feedback Mode. The bytes supplied are processed and returned immediately.

References:

  1. Bruce Schneier, "Section 9.8 Output Feedback Mode," and "Section 9.11 Choosing a Cipher Mode," Applied Cryptography, 2nd edition, John Wiley & Sons, 1996

  2. sci.crypt FAQ, "Part 5: Product Ciphers," ftp://ftp.rtfm.mit.edu/pub/usenet/news.answers/cryptography-faq/part05

  3. National Bureau of Standards (now NIST), "DES Modes of Operation," NBS FIPS PUB 81, U.S. Department of Commerce, December 1980

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.5 $

Author:
David Hopwood, Raif S. Naffah

Constructor Index

 o OFB()
Constructs an OFB cipher, assuming that the IV will be provided via setInitializationVector.
 o OFB(Cipher)
Constructs an OFB cipher, assuming that the IV will be provided via setInitializationVector.
 o OFB(Cipher, byte[])
Constructs a OFB cipher, using an initialization vector provided in the constructor.

Method Index

 o engineBlockSize()
SPI: Returns the length of a block, in bytes.
 o engineInitDecrypt(Key)
SPI: Initializes this cipher for decryption, using the specified key.
 o engineInitEncrypt(Key)
SPI: Initializes this cipher for encryption, using the specified key.
 o engineUpdate(byte[], int, int, byte[], int)
SPI: This is the main engine method for updating data.

Constructors

 o OFB
 public OFB()
Constructs an OFB cipher, assuming that the IV will be provided via setInitializationVector.

The IV value must be unique during the lifetime of the key. If it is not unique, and an attacker has access to a different message encrypted under the same IV and key, all of the plaintext can normally be recovered.

 o OFB
 public OFB(Cipher cipher)
Constructs an OFB cipher, assuming that the IV will be provided via setInitializationVector. See the previous constructor for more details.

Parameters:
cipher - the cipher object to use in OFB mode.
Throws: NullPointerException
if cipher == null
Throws: IllegalBlockSizeException
if cipher.getPlaintextBlockSize() != cipher.getCiphertextBlockSize()
 o OFB
 public OFB(Cipher cipher,
            byte iv[])
Constructs a OFB cipher, using an initialization vector provided in the constructor.

The IV value must be unique during the lifetime of the key. If it is not unique, and an attacker has access to a different message encrypted under the same IV and key, all of the plaintext can normally be recovered.

Parameters:
cipher - the block cipher to use
iv - the initial value for the shift register (IV)
Throws: NullPointerException
if cipher == null

Methods

 o engineBlockSize
 protected int engineBlockSize()
SPI: Returns the length of a block, in bytes.

Overrides:
engineBlockSize in class Cipher
 o engineInitEncrypt
 protected void engineInitEncrypt(Key newkey) throws KeyException
SPI: Initializes this cipher for encryption, using the specified key.

Overrides:
engineInitEncrypt in class Cipher
 o engineInitDecrypt
 protected void engineInitDecrypt(Key newkey) throws KeyException
SPI: Initializes this cipher for decryption, using the specified key.

Overrides:
engineInitDecrypt in class Cipher
 o engineUpdate
 protected int engineUpdate(byte in[],
                            int inOffset,
                            int inLen,
                            byte out[],
                            int outOffset)
SPI: This is the main engine method for updating data. It may be called with any size of input.

in and out may be the same array, and the input and output regions may overlap.

Parameters:
in - the input data.
inOffset - the offset into in specifying where the data starts.
inLen - the length of the subarray.
out - the output array.
outOffset - the offset indicating where to start writing into the out array.
Returns:
the number of bytes written.
Overrides:
engineUpdate in class Cipher

All Packages  Class Hierarchy  This Package  Previous  Next  Index