Test User

Greenhorn
+ Follow
since May 21, 2007
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 Test User

HI while encrypting Code is not using Bas64Endoder to encode . They have written there own custom Method to Encode the bytes to String
and have a custom Method to Decode the string before decrypting.
The whole process of encrypting and decrypting works fine if its totally done in Dot Net.
But If I try to Encrypt in Dotnet and try tp decrpyt in Java. I am getting the Badpadding Exception.
The Padding Mode used in Dotnet code in Padding.Zeros. But I do not find the equivalent padding mode in Java ( JCE). Could any one suggest how it can be done.

I found that if the Dotnet COde uses padding Mode as PKCS7 then it could be decrpted in my Java code using PKCS5PAdding... But our requirement is it needs to be done PAddingZeros in Dot net and have to get a solution in Java?
You Suggestions are welcome
16 years ago
Hi,
I too am facing the same exception BadPaddingException: Given final block not properly padded

I have tried converting the ChiperText String to bytes using the Base64Decoder as well as String.getBytes(). even after doing this I see the same Exception.
In my case The encryption is being done in Dot Net code. and the decryption happens in Java Code.
I suspect the Issue here in the Below Code:
The Encryption Algorithm is TripleDES ( DESede).
and to encrypt the mode and padding is given as below:
Mode: CBC
Padding = Padding.Zeros

But I am not sure which Padding mode to be used. I am using CBC/PKCS5Padding mode/padding.

Can any one specify which is the equivalent Padding mode to the DotNet Zeros Padding.

You Suggestions are most awaited..
Thanks
16 years ago