Sharkysoft home

lava.security.des
Class DesFbCoder

java.lang.Object
  |
  +--lava.security.des.DesFbCoder
Direct Known Subclasses:
DesCfbDecoder, DesCfbEncoder, DesOfbCoder

public abstract class DesFbCoder
extends java.lang.Object
implements ITextTransform

Base class for Cipher/Output FeedBack (C/OFB) coders.

Details: DesFbCoder contains definitions that are common to the DES feedback coders, namely, the cipher feedback (CFB) and output feedback (OFB) coders. The DES feedback coders are described in FIPS PUB 81.

DES normally processes data in 64-bit chunks. However, many security applications work best with different chunk sizes. For example, a program that encrypts files might be easier to design if it encrypted data one byte at a time, since not all files have lengths that are multiples of 8 bytes.

The CFB and OFB modes of DES allow the applications to use DES with symbols of any width between 1 and 64 bits. These alternative modes are not any less secure than standard DES. For a description of how these modes work, refer to the subclass documentation.

The manner in which the CFB and OFB modes utilize DES can easily be applied to other 64-bit block ciphers, such as 3DES. Therefore, the constructors for the subclasses allow the application programmer to specify not just a DesEngine, but any IBlockCipher64 implementation.

This base class is not usable to the application programmer in any way and is public only to make the JavaDoc comments visible.

Since:
1999.08.16
Author:
Sharky

Method Summary
 void beginTransform()
          Resets transform.
 int completeTransform(java.lang.Object dest)
          ITextTransform interface method.
 int getTransformInputWidth()
          ITextTransform interface method.
 int getTransformOutputWidth()
          ITextTransform interface method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

beginTransform

public final void beginTransform()
Description copied from interface: ITextTransform
Resets transform.

Details: beginTransform initializes this transform in preparation for processing a new input text stream.

Specified by:
beginTransform in interface ITextTransform

completeTransform

public final int completeTransform(java.lang.Object dest)
ITextTransform interface method.

Details: See ITextTransform for a description of this interface method's contract.

This implementation produces no output symbols because DES feedback ciphers never "lag behind." (In other words, all output data is immediately returned from continueTransform.)

Specified by:
completeTransform in interface ITextTransform
Parameters:
dest - ignored
Returns:
0

getTransformInputWidth

public final int getTransformInputWidth()
ITextTransform interface method.

Details: See ITextTransform for a description of this interface method's contract.

This implementation returns the value of k provided to the constructor.

Specified by:
getTransformInputWidth in interface ITextTransform
Returns:
k

getTransformOutputWidth

public final int getTransformOutputWidth()
ITextTransform interface method.

Details: See ITextTransform for a description of this interface method's contract.

This implementation returns the value of k provided to the constructor.

Specified by:
getTransformOutputWidth in interface ITextTransform
Returns:
k

Sharkysoft home