Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.crypto.BadPaddingException

 
Arpit Panwar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i keep getting badpading exception.
can anyone help me out on how to pad the message bits.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic