It's not a secret anymore!
The moose likes Security and the fly likes javax.crypto.BadPaddingException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "javax.crypto.BadPaddingException" Watch "javax.crypto.BadPaddingException" New topic


Arpit Panwar

Joined: Jul 16, 2009
Posts: 12

i keep getting badpading exception.
can anyone help me out on how to pad the message bits.

SCJP 75%
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
This exception usually happens when encrypted data, or an encryption key, is treated like character data (in other words, as a string). Here's a full example of AES encryption/decryption:
I agree. Here's the link:
subject: javax.crypto.BadPaddingException
It's not a secret anymore!