java.security.InvalidKeyException: The wrapped key is not padded correctly.
KeyGenerator and Cipher is created with algorithm as "DES". Parameters are not given. I encrypt a file and wrap the key and store in a file. In a sperate call, i try to decrypt the encrypted file, after unwrapping the encrypted key. Here I get the exception, while unwrapping.
To eliminate error in reading the key from file for unwrapping, I tried calling decrypt immediately after encrypt and all works fine (encrypting, wrapping, unwrap key from file and decrypting). The problem happens when i try to use it with another instance of the class or with a new JVM. I have no clue on how to debug this problem.
Can someone help me and enlighten on what I might possibly be doing wrong.