长话短说,我使用的DES和我使用RSA加密密码交换,密码不超过16个字符 问题是当我加密密钥,加密大小变得对我来说太大解密 这里是我的RSA加密和解密代码:无法解密RSA加密密钥
加密: - 我一直在努力的localpwd为“ASD”
byte[] plaintext = utf8.GetBytes(localpwd);
byte[] ciphertext = rsaservice.Encrypt(plaintext, false);
string cipherresult = Convert.ToBase64String(ciphertext);
然后我打印加密的密钥对文本框并尝试解密
byte[] ciphertext = utf8.GetBytes(filetest.Text);
byte[] plain = rsaservice.Decrypt(ciphertext, true);
string plaintext = utf8.GetString(plain);
我得到“要解密的数据超过这个256字节模数的最大值”。 我试图增加密钥大小能够加密和解密较大的密钥大小,但增加密钥只是增加了加密数据的大小导致相同的错误 请帮助!
我没有看到ToBase64String的'反向()' – 2012-04-28 09:52:39
我使用utf8编码来获得转换为字节NAD回串再次 – 2012-04-28 10:20:20