该工具类中用到了BASE64,需要借助第三方类库:javabase64-1.3.1. jar 注意:RSA加密明文最大长度117字节,解密要求密文最大长度为128字节,所以在加密和解密的过程中需要分块进行. RSA加密对明文的长度是有限制的,如果加密数据过大会抛出如下异常: Exception in thread "main" javax.crypto.IllegalBlockSizeException: Data must not be longer than 117 bytes a
using System;using System.Security.Cryptography;using System.Text; class RSACSPSample{ static void Main() { try { string str_Plain_Text = "How are you?How are you?How are you?How are you?=-popopolA"; Consol