Sharkysoft home

lava.security.des
Class TripleDesKey

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

public final class TripleDesKey
extends java.lang.Object

DES key.

Details: This class defines a 3DES key, which can be used to initialize a TripleDesCipher.

bit ordering

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

Since:
1999.08.08
Author:
Sharky
See Also:
DesKey, TripleDesEngine

Constructor Summary
TripleDesKey(byte[] bytes, int offset)
          Specifies key as a byte sequence.
TripleDesKey(DesKey key1, DesKey key2, DesKey key3)
          Specifies all three keys.
TripleDesKey(int[] halves, int offset)
          Specifies 32-bit left and right halves.
TripleDesKey(long[] keys, int offset)
          Specifies 64-bit keys.
 
Method Summary
 boolean hasOddParity()
          Tests for odd parity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleDesKey

public TripleDesKey(DesKey key1,
                    DesKey key2,
                    DesKey key3)
Specifies all three keys.

Details: This constructor initializes a new 3DES with the three given single-DES keys.

Parameters:
key1 - the first key
key2 - the second key
key3 - the third key

TripleDesKey

public TripleDesKey(long[] keys,
                    int offset)
Specifies 64-bit keys.

Details: This constructor initializes a new 3DES key using the three given 64-bit integers. The first key is index by offset.

Parameters:
keys - the 64-bit keys
offset - index of first key

TripleDesKey

public TripleDesKey(int[] halves,
                    int offset)
Specifies 32-bit left and right halves.

Details: This constructor initializes the key using the 32-bit left and right halves provided. The left half of the first key is index by offset and the right half is index by offset + 1.

Parameters:
halves - the left and right halves
offset - index of left half

TripleDesKey

public TripleDesKey(byte[] bytes,
                    int offset)
Specifies key as a byte sequence.

Details: This constructor initializes the key using the given 24 bytes. The first 8 bytes make up the first key. The bytes are assembled in big endian order, and the first byte of the first key is indexed by offset

Parameters:
bytes - the byte array
offset - index of first byte
Method Detail

hasOddParity

public boolean hasOddParity()
Tests for odd parity.

Details: This method determines whether all three of the individual DES keys that make up this 3DES key have odd parity.

Returns:
true iff parity is odd
See Also:
DesKey.hasOddParity()

Sharkysoft home