I am the AES-GCM encryption user on my server, and decrypt it on my android client. However I'm having a conversion problem.
We assume that:
1- Encrypted text generates value in bytes: [B@541fe858
2- This value is embedded in JSONObject
and sent to the client.
3- The client receives this value with:
String cryptoJSON = JSONencryptedresponseWS.getString("crypto");
That results in the correct value of [B@541fe858
.
4- However then this String must be converted to bytes, to pass this value to the decrypt function. The problem is that by doing the methods cryptoJSON.getBytes
or using base64.decode
, it results in a different value than expected (ie [B@f2f55b3
).
Does anyone know how to extract the concrete value that is in String
to byte format, do a direct conversion?