Folks:
I am getting the error (subject line) - when I try to decrypt on Solaris 10 OS. It works fine on Windows 2003 and Linux and also on Solaris 9.0. Any clues about this.
The stack trace is:
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.BlowfishCipher.engineDoFinal(DashoA12275)
at javax.crypto.Cipher.doFinal(DashoA12275)
at com.powerup.configmgr.util.commandline.credentials.CryptoHelper.decrypt(CryptoHelper.java:123)
The line number 123 is the line below correspoinding to doFinal method call.
public static synchronized byte[] decrypt(byte[] input)
throws Exception
{
byte[] ret = null;
// System.out.println("ENCRYPTED INPUT= "+input);
Cipher c = getCipher();
c.init(Cipher.DECRYPT_MODE,getSecretKey(),getSalt());
if(input != null)
ret = c.doFinal(input);
else
ret = new byte[0];
// System.out.println("DECRYPTED INPUT="+ret);
return ret;
}