Perfect solution to the problem of Android client RSA decryption part garbled code

  • 2021-08-28 21:01:19
  • OfStack

Today, when using the data of rsa interface server, I encountered some garbled problems. Although I can decrypt the correct data, there will be 1 pile of garbled codes in front of me. 1 At first, I thought it was a coding problem, but all of them were set to utf-8.

The final solution is as follows:

Use Cipher. getInstance ("RSA/ECB/PKCS1Padding") when obtaining the decrypted Cipher class on the mobile terminal;

Use Cipher. getInstance ("RSA") at the back end; To get.


Related articles: