This is my code so far. Every time I run it, I receive a bad padding exception only while trying to decrypt. If I swap the use of my private and public keys it still throws the same exception in decrypt. This makes me believe that it is an issue with the Decrypt itself. Any thoughts on what I am doing wrong?
try {
Cipher Bob_Message_Verify = Cipher.getInstance("RSA");
Bob_Message_Verify.init(Cipher.DECRYPT_MODE, Alice_Pair_I.getPublic());
Bob_Verification_Message_Decrypt = (Bob_Message_Verify.doFinal(Bob_Verification_Message_Encrypt));
}catch(NoSuchAlgorithmException e)
{
throw new OTPException("Not RSA");
}
catch(IllegalBlockSizeException e)
{
throw new OTPException("Wrong Block Size");
}
catch(NoSuchPaddingException e)
{
throw new OTPException("No Padding");
}
catch(InvalidKeyException e)
{
throw new OTPException("Invalid Key");
}
catch(BadPaddingException e)
{
throw new OTPException("Bad Padding");
}