長話短說,我使用的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