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!

"Given final block not properly padded" when using wrong secretKey

843810Jul 22 2003 — edited Jul 23 2003
Hello guys, I browsed the questions in this forum regarding my problem, but somehow couldn't find a solution to this.

I generated two SecretKey key1 and key2. Now I'm using the Cipher class to encrypt a message to key1. If I try to decrypt it with key1, everything works fine. But if I try key2 I get the "Given final block not properly padded"-message in my exception backtrace instead of just unreadable stuff, which I excepted (using the wrong key). This happens regardless of the symetric algorithm I use.

Can you help me?
Thanks,
Sebastian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2003
Added on Jul 22 2003
5 comments
210 views