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