converting 64 bits to a DES Key

  • Follow


I have 64 bits(i.e. byte[8]) that I need to embed in some kind of
javax.crypto.Key so I can use it for DES encryption.

I want to do something like:

import javax.crypto.Cipher;

// Build the key
byte[] key_codes = { 0x34, 0x33, 0x8a, 0x01, 0x12, 0x5a, 0x43, 0x12 };
Key key = new Key( key_codes );

// build the cipher
Cipher ecipher = Cipher.getInstance("DES");
ecipher.init( javax.crypto.Cipher.ENCRYPT_MODE, key );

// Use the cipher
......

I need a Key to use the Cipher but I can't find anywhay to directly
enter the key values.

Any help is much appreciated...

thanks,
Dean Rettig
0
Reply rettigcd 2/26/2004 1:27:58 AM


0 Replies
288 Views

(page loaded in 0.968 seconds)

Similiar Articles:













7/27/2012 5:29:09 PM


Reply: