ASP.NET 用RSA加密得到的密文每次都是不同的吗?
string publickey = "<RSAKeyValue><Modulus>um/wVc4bH+YVN6fK2yqc5ulME/NkC79TW6DX0c1qiBsnXqgqYDG47gdYtHgQQqLyZe5MVtlJ1aL/JN9o4FsCK1EpRIAO//9XtJS4HJkCkiwNT2SAwd8W1nVKwchHMJE8+4tYWfeUSJ5ikKodh0+vooSSMnJfjC4ywRttjzzONW0=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"; //导出 rsa1 的公钥
string plaintext;
plaintext = "abc"; //原始数据
rsa2.FromXmlString(publickey); //rsa2 导入 rsa1 的公钥,用于加密信息
//rsa2开始加密
byte[] cipherbytes;
cipherbytes = rsa2.Encrypt(
Encoding.UTF8.GetBytes(plaintext),
false);
Label1.Text = Convert.ToBase64String(cipherbytes);
这样得到的密文怎么是变动的呢?
高手指点下
------解决方案--------------------重复发帖...去学学PKI原理吧,否则告诉你你也很难听懂...