"Given final block not properly padded" when using wrong secretKey
843810Jul 22 2003 — edited Jul 23 2003Hello 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