Sharkysoft home

lava.security.des
Class DesEngine

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

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

Optimized DES implementation.

Details: DesEngine is an efficient implementation of the DES private key encryption/decryption algorithm described in FIPS PUB 46.

DES is a 64-bit block cipher, which means that it processes data in 64-bit chunks. This implementation allows multiple blocks to be loaded into an array so that the blocks can be processed with a single method call. The encrypted/decrypted results can be returned in the same or different array.

initial and final permutations

Optionally, if one is willing to sacrifice perfect conformance to the DES standard in exchange for faster processing, individual instances of DesEngine can be configured to skip the initial and final permutations. These permutations do not contribute to the security of DES but are part of the standard.

bit ordering

Refer to the package summary for important information regarding bit ordering.

usage

DesEngine is an implementation of IBlockCipher64. You must understand the contract specified by that interface before you can have any success using this class. Please read it!

Since:
1999.08.03
Version:
2001.03.09

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

Constructor Detail

DesEngine

public DesEngine(DesKey key,
                 boolean itpe,
                 boolean ftpe)
Sets key; enables/disables permutations.

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

Parameters:
key - the encryption key
itpe - initial text permutation enabled
ftpe - final text permutation enabled

DesEngine

public DesEngine(DesKey key)
Sets key.

Details: This constructor initializes a new DesEngine instance to perform standard DES encryption/decryption using the specified key.

Parameters:
key - the encryption key
Since:
1999.08.17
Method Detail

encrypt

public final void encrypt(java.lang.Object src,
                          java.lang.Object dest,
                          int length)
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 - the source array
dest - the destination array
length - the number of elements in the source array

decrypt

public final void decrypt(java.lang.Object src,
                          java.lang.Object dest,
                          int length)
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 - the source array
dest - the destination array
length - the number of elements in the source array

Sharkysoft home