aspose file tools
The moose likes Security and the fly likes Standard DES? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Security
Reply Bookmark "Standard DES?" Watch "Standard DES?" New topic
Author

Standard DES?

Lavern Matthew
Ranch Hand

Joined: Jun 05, 2004
Posts: 38
I have been asked to encrypt data using standard DES. I am having a hard time finding details on how to do this. I was given the following byte arrays:

private byte[] KEY_64 = new byte[] {12, 26, 92, 218, 58, 8, 156, 52};
private byte[] IV_64 = new byte[] {45, 167, 234, 59, 34, 76, 103, 9};

All the tutorials I have found start off by generating a key. I have both keys already


Matthew Wilson<br />-http://valuelist.sourceforge.net
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35256
    
    7
The http://faq.javaranch.com/java/SecurityFaq points to several resources related to JCE (the Java API for encryption). One of those shows DES in detail. Since you already have the key, you can use the SecretKeySpec class to construct a SecretKey object from that, and leave those parts from the example.

These days, I'd rather use TripleDES or AES than DES, though.


Android appsImageJ pluginsJava web charts
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4422
    
    2

Nice key. Most folks have odd values in the bytes, which DES ignores the lowest bit.

These days DES is useful only for training. Its obsolete. AES is the approved replacement. TripleDES is used, but its much slower than AES.
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
218, 156, etc. are not java bytes, so you're two lines won't even compile.


Nice to meet you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Standard DES?
 
Similar Threads
Problem encrypting with openssl, decrypting with bouncy castle
Characters jumbled pls help
8- byte array Intialization Vector
How to encrypt & decrypt Random DES key with DES?
Algorithm DES not available