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!

Invalid Key Length Issues using Triple DES Encryption

843811Oct 10 2007 — edited Oct 11 2007
Hello All,

I am trying to troubleshoot a class that a previous colleague/developer wrote that used 3DES encryption. Up until today, the app and class were functioning correctly.

Snippet of method:

...
try {
   Cipher myCipher = Cipher.getInstance("DES.....");
   myCipher.init(Cipher.ENCRYPT_MODE, myKey);

   byte[] inByte = myEncryptedString.getBytes("UTF8");
   byte[] outByte = cipher.doFinal(inByte);

   BASE64Encoder myEncoder = new BASE64Encoder();
   newEncryptedString = myEncoder .encode(output);
}
.....

Unfortuantely I have little experience with java.crypto and would ask for any help in troubleshooting the following exception I'm receiving:

Invalid key length: 24 bytes

Thanks for any help you might be able to suggest!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2007
Added on Oct 10 2007
3 comments
641 views