Android/JVM difference in RSA decryption

前端 未结 2 1085
南方客
南方客 2020-12-29 16:58

I am trying to decrypt a String, that I have encrypted elsewhere. Here is my code:

private void test() {

    try {
        String stringMessage=\"Sf3O7Lr2+W         


        
2条回答
  •  时光说笑
    2020-12-29 17:50

    It is possible your feeding the KeyFactory garbage since you are reading into a 2000 byte array, and your key is probably something like 128 (1024 bits) or 256 (2048 bits) bytes long. Additionally, you shouldn't really use RSA for encryption directly: there are security issues with this the data size you can encrypt is limited by the RSA key size.

提交回复
热议问题