Sharkysoft home

lava.security.des
Class DesCbcCoder

java.lang.Object
  |
  +--lava.security.des.DesCbcCoder
Direct Known Subclasses:
DesCbcDecoder, DesCbcEncoder

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

Base class for Cipher Block Chaining (CBC) coders.

Details: Cipher Block Chaining (CBC) is a special operating mode of DES used to enhance the block cipher's security. CBC is described in FIPS PUB 81. This class contains definitions common to both the encryptor and the decryptor.

Unlike DES in electronic codebook (ECB) mode, a CBC DES cipher machine has a state that mutates as it processes data. Therefore, it is inappropriate to encrypt or decrypt multiple streams with the same DesCbcCoder instance. A single instance should be used for encrypting only or decrypting only, but not both, and should only be used to process one stream.

The chaining mechanism used by CBC can be applied to any 64-bit block cipher, not just DES. Hence, although this class was designed to be used primarily with DesEngine, it can actually be used with other IBlockCipher64 implementations as well.

This class conforms to the ITextTransform API. However, because the input and output symbol width is 64 bits, only long arrays can be used with the continueTransform method.

For efficiency reasons, this class and its subclasses are not thread-safe.

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
 int completeTransform(java.lang.Object output)
          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

completeTransform

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

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

This implementation does not produce any output symbols and always returns 0.

Specified by:
completeTransform in interface ITextTransform
Parameters:
output - 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 64.

Specified by:
getTransformInputWidth in interface ITextTransform
Returns:
64

getTransformOutputWidth

public final int getTransformOutputWidth()
ITextTransform interface method.

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

This implementation returns 64.

Specified by:
getTransformOutputWidth in interface ITextTransform
Returns:
64

Sharkysoft home