File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes BadPaddingException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "BadPaddingException" Watch "BadPaddingException" New topic
Author

BadPaddingException

IT
Greenhorn

Joined: Feb 07, 2007
Posts: 1
i have a problem in decrypting a message on the client side, as it shows the BadPaddingException:Final block is not padded properly. i am using DES, and using getInputStream and getOutputStream for sending and receiving data, first reading the length of the bytes n then byte itself. problem is, it works properly at first time, even for two clients but next time it shows exception.

please help.
thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
Hello-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.


Ping & DNS - my free Android networking tools app
Kevin Baker
Greenhorn

Joined: Jun 20, 2002
Posts: 10
I had a similar problem just the other day. What I noticed is I was encrypting 16 bytes of data and the result was 32 bytes, but when I was sending the data I assumed I had 16 bytes. This essentially sheared the Padding bytes off. Print the length of the input byte array and then the length of the output byte array and compare.

I hope this is your issue also
Good luck

PS. I also receive this error when I didn�t have the correct policy files!
 
 
subject: BadPaddingException
 
Similar Threads
About EL
Generate xhtml problem. Help!
netscape
How to setup directory structure fpr Tomcat
WSAD5.0.1 jdbc:odbc problem : No suitable Driver