3DES decryption with SHA1 hashed key
843811Jan 25 2007 — edited Sep 29 2008Hello 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.