You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invalid hmac means either your data is corrupted or you have the wrong password. The input must be precisely (byte for byte) the output of the encryptor.
yes, i find the reason,it's caused by gson, it filtered the escape character like " / " and " ' " and so on,so the data is corrupted,i use "Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();" to solve the issue.
Thank you for the support,there is still another problem,it's too slow in android, it takes me about 3.2s to decrypt,so i'm afraid of i can't use it, hope it can be solved soon~
this is the problem about "jncryptor.InvalidHMACException" in android, when i use gson and Base64.decode before the decrypt:
Gson gson = new Gson();
AES256JNCryptor aes256JNCryptor = new AES256JNCryptor();
String string = gson.toJson(data);
byte[] bytes = Base64.decode(string, 0);
then it throw the exception:
com.ilikelabsapp.MeiFu.frame.utils.jncryptor.InvalidHMACException: Incorrect HMAC value.
com.ilikelabsapp.MeiFu.frame.utils.jncryptor.AES256JNCryptor.decryptV3Data(AES256JNCryptor.java:248)
com.ilikelabsapp.MeiFu.frame.utils.jncryptor.AES256JNCryptor.decryptData(AES256JNCryptor.java:280)
com.ilikelabsapp.MeiFu.frame.entity.EncryptNetworkResponse.getData(EncryptNetworkResponse.java:55)
if only i don't use the base64.decode, then it will throw the exception:
jncryptor.CryptorException: Unrecognised version number: 34.
com.ilikelabsapp.MeiFu.frame.utils.jncryptor.AES256JNCryptor.decryptData(AES256JNCryptor.java:283)
com.ilikelabsapp.MeiFu.frame.entity.EncryptNetworkResponse.getData(EncryptNetworkResponse.java:56)
i don't kow how to slove the InvalidHMACException, did i do anything wrong?
Thank you~
The text was updated successfully, but these errors were encountered: