Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2004, 01:54 AM   PM User | #1
bboyle
New to the CF scene

 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
bboyle is an unknown quantity at this point
javax.crypto.BadPaddingException

Hi!

I have an exception when I am decrypting a SealedObject:

javax.crypto.BadPaddingException: Given final block not properly padded

I encrypt my SealedObject using a DES key. This key is saved as a variable and passed to the decryption method and used to decrypt the SealedObject. This is the code for it
Code:
desKey = keyGen.generateKey();
public Vote decryptVote(SealedObject so, desKey)
{
Cipher decipher;
Vote vote = null;
try {   
decipher = Cipher.getInstance("DES");
decipher.init(Cipher.DECRYPT_MODE, desKey);  
vote = (Vote) so.getObject(decipher);
} catch (NoSuchPaddingException e) 
{  System.out.println("");  
e.printStackTrace();
I have used my IDE debugger and looked at my code and I can see that the data in my Key is the dame at encryption time and decryption time. I'd be grateful if anyone could help me with this.

Thanks,

B
bboyle is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:22 PM.


Advertisement
Log in to turn off these ads.