incorrect decryption using AES/CBC/PKCS5Padding in Android

半世苍凉 提交于 2019-11-30 05:47:55

If you take out the encrypt-decrypt, which should be an identity transformation, what remains is:

Base64.encodeToString(Base64.decode(msg))

"Msg 1.5 to encrypt" isn't a Base64-encoded string, there's no need to try to decode it. If you do, as you do, non-Base64 characters get stripped and you get some bytes which, when encoded back, look like the result you get.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!