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!

3DES decryption with SHA1 hashed key

843811Jan 25 2007 — edited Sep 29 2008
Hello all,

I've been given the task of rewriting an existing VB application in Java, and one routine makes use of the Microsoft Cryptography API.

The VB code decrypts a string using TripleDES decryption, using a string key that's been hashed with a SHA1 has algorithm.

Most of the java DESede encryption/decryption examples I've worked through generate keys with a KeyGenerator instance, but I have not yet found any examples that use a key that's been SHA1 hashed.

My attempts at using a hashed byte[] array of my key phrase with a DESede Crypto instance always return a "wrong key size" error.

Can anyone provide some help? Example code fragments or anything would help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2008
Added on Jan 25 2007
8 comments
2,558 views