Hi
in InputText_Decode.java
please replace the:
import org.apache.commons.codec.binary.Base64;
to:
import java.util.Base64;
then change
// Decrypt the Text
try
{
// Decode the base64
byte[] baseDecode = Base64.decodeBase64(parseStripes(InputText).getBytes());
// Initialize a cipher to decrypt the text.
Cipher cipher = Cipher.getInstance(certificate.getPublicKey().getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, certificate);
// Decrypt and return text.
return new String(cipher.doFinal(baseDecode));
} catch (Exception ex)
to;
// Decrypt the Text
try
{
// Decode the base64
//byte[] baseDecode = Base64.decodeBase64(parseStripes(InputText).getBytes());
//Updated the Base64 encoding from apache to java. (due to java 1.8)
byte[] baseDecode = Base64.getDecoder().decode(parseStripes(URLEncoder.encode(InputText)));
// Initialize a cipher to decrypt the text.
Cipher cipher = Cipher.getInstance(certificate.getPublicKey().getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, certificate);
// Decrypt and return text.
return new String(cipher.doFinal(baseDecode));
} catch (Exception ex)
This will fix the issue. (Thanks to my colleague Diego who helped me with this)