Too much data for RSA block fail. What is PKCS#7?

前端 未结 7 864
予麋鹿
予麋鹿 2020-11-30 07:11

Talking about javax.crypto.Cipher

I was trying to encrypt data using Cipher.getInstance(\"RSA/None/NoPadding\", \"BC\") but I got the excep

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 07:25

    You should not encrypt your data using RSA directly. Encrypt your data with a random symmetric key (i.e. AES/CBC/PKCS5Padding) and encrypt the symmetric key using RSA/None/PKCS1Padding.

提交回复
热议问题