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!

Wrap/Unwrap error >>> InvalidKeyException: pad block corrupted...???

843810Aug 11 2003 — edited Aug 14 2003
get this error:

java.security.InvalidKeyException: pad block corrupted
        at org.bouncycastle.jce.provider.WrapCipherSpi.engineUnwrap(WrapCipherSpi.java:298)
        at javax.crypto.Cipher.unwrap(DashoA6275)
        at Slave$1.onArrival(Slave.java:329)
        at com.ibm.aglet.Aglet.processMobilityEvent(Unknown Source)
        at com.ibm.aglet.Aglet.dispatchEvent(Unknown Source)
        at com.ibm.aglets.LocalAgletRef.dispatchEvent(Unknown Source)
        at com.ibm.aglets.EventMessage.handle(Unknown Source)
        at com.ibm.aglets.AgletThread.run(Unknown Source)
 
when trying to execute this code:
KeyGenerator keyGen = KeyGenerator.getInstance("DES", "BC");
Key unWrapKey = keyGen.generateKey();                                                                     
Cipher keyCipher = Cipher.getInstance("Blowfish", "BC");
keyCipher.init(Cipher.UNWRAP_MODE, unWrapKey);
Key key = keyCipher.unwrap(encryptedKeyBytes, "DES", Cipher.SECRET_KEY);
Anyone know what the problem might be?

Thanks,
blake

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2003
Added on Aug 11 2003
7 comments
2,404 views