net.vattp.data
Class TripleDESKeyConstructor

java.lang.Object
  |
  +--net.vattp.data.TripleDESKeyConstructor

final class TripleDESKeyConstructor
extends Object

Utility method for constructing a 3DES key from a Diffie-Hellman secret.

Author:
This file contains only code created by Tyler Close, not a citizen or resident of the US.

Field Summary
private static int DES_KEY_LENGTH
           
private static String DIGEST_ALGORITHM_NAME
           
private static int KEY_PAD_LENGTH
           
private static int TRIPLE_DES_KEY_LENGTH
           
 
Constructor Summary
(package private) TripleDESKeyConstructor()
           
 
Method Summary
private static void fill(byte[] buffer, byte value)
           
(package private) static byte[] make(byte[] dhSecret)
          Constructs a 3DES key from a Diffie-Hellman secret.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIGEST_ALGORITHM_NAME

private static final String DIGEST_ALGORITHM_NAME

DES_KEY_LENGTH

private static final int DES_KEY_LENGTH

TRIPLE_DES_KEY_LENGTH

private static final int TRIPLE_DES_KEY_LENGTH

KEY_PAD_LENGTH

private static final int KEY_PAD_LENGTH
Constructor Detail

TripleDESKeyConstructor

TripleDESKeyConstructor()
Method Detail

make

static byte[] make(byte[] dhSecret)
Constructs a 3DES key from a Diffie-Hellman secret. The individual keys are calculated from a Diffie-Hellman secret using MD5 and a 16 byte pad consisting of a single byte repeated 16 times as follows: 3DESKey1 is the first 8 bytes of md5((16,pad)(n,dhSecret)) with 0x55 for the pad. 3DESKey2 is the second 8 bytes of md5((16,pad)(n,dhSecret)) with 0x55 for the pad. 3DESKey3 is the first 8 bytes of md5((16,pad)(n,dhSecret)) with 0xaa for the pad.

Parameters:
dhSecret - the Diffie-Hellman secret
Returns:
a byte[] containing the constructed key.
See Also:
cryptix.provider.key.RawKey,

fill

private static void fill(byte[] buffer,
                         byte value)


comments?