RSA Encryption with given public key (in Java)

后端 未结 4 2232
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 10:35

I\'m looking for a Java sample how to do RSA Encryption with a given public key (I have it in base64 format, seems it is 1024 bit length).

Below is

4条回答
  •  爱一瞬间的悲伤
    2020-12-07 11:02

    Your public key does not look like a Base64 encoded 1024 bit value. A 1024 bit value would require 172 characters (the last one being a filler =) and here we have 175 chars.

    For a test, replace the last four characters in your String with a single = and test if this eliminates the exception. This won't solve the problem but may point in correct direction.

提交回复
热议问题