When decrypting a String with com.googlecode.gwt.crypto.client.TripleDesCipher#decrypt
the following exception is thrown:
java.lang.ArrayIndexOutOfBoundsException: -59
at com.googlecode.gwt.crypto.bouncycastle.util.encoders.HexEncoder.decode(HexEncoder.java:106)
at com.googlecode.gwt.crypto.bouncycastle.util.encoders.Hex.decode(Hex.java:86)
at com.googlecode.gwt.crypto.client.TripleDesCipher.decrypt(TripleDesCipher.java:51)
The String that is passed to the method contains a special character.
Has anyone of you encountered such an error before?
The String that is passed to the decrypt
method contains the special character Ţ
. It is encoded in UTF-8 but is somehow parsed by the TripleDesCipher
as ISO-8859-1.