Rajkumar Sathiyamurthy

Greenhorn
+ Follow
since May 21, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rajkumar Sathiyamurthy

We have provided an API to our clinet, which they use to encrypt the string and they will send the encrypted string as request parameter to our end.
On receiving the string we will decrypt the string before processing further.
But while decrypting we receive the below error.

Client use JDK 1.6 to encrypt and we use JDK 1.5 at our end to decrypt



javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
at com.sun.crypto.provider.AESCipher.engineDoFinal(DashoA12275)
at javax.crypto.Cipher.doFinal(DashoA12275)
at com.sbi.crypto.aes.EncryptAES.decrypt(EncryptAES.java:84)




Line 84 is byte [] ciphertext=cipher.doFinal(results);

Below is the code to encrypt


Below is the code to decrypt




Kindly help us.
Thanks in advance.
14 years ago