This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes pad block corrupted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "pad block corrupted" Watch "pad block corrupted" New topic
Author

pad block corrupted

luca Sinzio
Greenhorn

Joined: Apr 09, 2007
Posts: 3
I'm developing a MIDlet for SMS encrypting. I use the AESlight (Rijndael) algorithm for cipher/decipher (usign Bouncy Castle APIs).
I cipher the sms then I send it as a BINARY message (because I can't trasform the ciphered text froma byte array to a String and then back to a byte array, without loosing data).
But when I decipher the received sms i get the "pad block corrupted" error message.
I tried to test if the decipher code was right adn it is, in fact on the sender side it decipher correctly the ciphered text. Then I checked if the received byte array would be the same of the sent one, and still it's right!

Here is the code I use to decipher:


Can someone help me finding a solution?
Is the problem in the binary message?
Here the code of sending the binary message:


Thank you in advance!
 
wood burning stoves
 
subject: pad block corrupted
 
Similar Threads
AES CFB/NoPadding with BouncyCastle LightWeight API
Problem encrypting with openssl, decrypting with bouncy castle
Bouncycastle AES - output isn't the same as input!
Error message: "pad block corrupted"
Help! Problem with Encryption!