Sharkysoft home

lava.security.des
Class TripleDesEngine

java.lang.Object
  |
  +--lava.security.des.TripleDesEngine

public final class TripleDesEngine
extends java.lang.Object
implements IBlockCipher64

Optimized 3DES implementation.

Details: TripleDesEngine is an efficient implementation of the 3DES chain cipher. A 3DES cipher is simply three, independently-keyed DES ciphers, operating in ECB mode, that are chained together. In 3DES, the data is encrypted using the first key, decrypted using the second key, and encrypted again using the third key. The reverse process (decrypt-encrypt-decrypt) recovers the data.

Except for key initialization, the interface to this class is identical to DesEngine. Make sure to read the documentation for class DesEngine before using this class.

Since:
1999.08.03
Version:
2001.03.09
See Also:
DesEngine

Constructor Summary
TripleDesEngine(TripleDesKey key)
          Sets triple-key.
TripleDesEngine(TripleDesKey key, boolean itpe, boolean ftpe)
          Sets triple-key; enables/disables permutations.
 
Method Summary
 void decrypt(java.lang.Object src, java.lang.Object dest, int srclen)
          Decrypts blocks.
 void encrypt(java.lang.Object src, java.lang.Object dest, int srclen)
          Encrypts blocks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleDesEngine

public TripleDesEngine(TripleDesKey key)
Sets triple-key.

Details: This constructor initializes a new TripleDesEngine instance for standard 3DES encryption/decryption.

Parameters:
key - the 3DES key

TripleDesEngine

public TripleDesEngine(TripleDesKey key,
                       boolean itpe,
                       boolean ftpe)
Sets triple-key; enables/disables permutations.

Details: This constructor initializes a new TripleDesEngine instance and enables or disables initial and final text permutations.

Parameters:
key - the 3DES key
itpe - initial text permutation enabled
ftpe - final text permutation enabled
Method Detail

encrypt

public final void encrypt(java.lang.Object src,
                          java.lang.Object dest,
                          int srclen)
Encrypts blocks.

Details:

See IBlockCipher64 (read all of it!) for a description of this interface method's contract.

Specified by:
encrypt in interface IBlockCipher64
Parameters:
src - source array
dest - destination array
srclen - number of elements in source array

decrypt

public final void decrypt(java.lang.Object src,
                          java.lang.Object dest,
                          int srclen)
Decrypts blocks.

Details:

See IBlockCipher64 (read all of it!) for a description of this interface method's contract.

Specified by:
decrypt in interface IBlockCipher64
Parameters:
src - source array
dest - destination array
srclen - number of elements in source array

Sharkysoft home