Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DES Key length

843811Jan 16 2009 — edited Jan 16 2009
I'm trying to create a DES cipher that will allow me to decipher text coming from a remote partner. They have given me the private key to use for decryption that is 16 bytes long. So I used the following code:
decryptCipher = Cipher.getInstance(CIPHER_NAME); //CIPHER_NAME="DES"
decryptCipher.init(Cipher.DECRYPT_MODE, key);
When I execute this I get:
Caused by: java.security.InvalidKeyException: Invalid key length: 16 bytes
        at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA13*..)
        at javax.crypto.Cipher.b(DashoA13*..)
        ...
I'm a little mystified as to how to proceed. Can someone help?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2009
Added on Jan 16 2009
4 comments
1,105 views