标题:这段代码错在那里啦?
取消只看楼主
dreamhouse
Rank: 1
等 级:新手上路
帖 子:107
专家分:7
注 册:2011-12-16
结帖率:59.46%
已结贴  问题点数:10 回复次数:0 
这段代码错在那里啦?
public void JIEMI(string strDESKey,string strCipher,string strDESIV)
        {
            byte[] bytesDESKey = ASCIIEncoding.ASCII.GetBytes(strDESKey);//密匙
            byte[] bytesSDESIV = ASCIIEncoding.ASCII.GetBytes(strDESIV);//向量
            byte[] bytesCipher = ASCIIEncoding.Unicode.GetBytes(strCipher);//密文
            DESCryptoServicePrvoider desDecrypt = new DESCryptoServicePrvoider();
            MemoryStream msDecrypt = new MemoryStream(bytesCipher);
            CryptoStream csDecrypt = new CryptoStream(msDecrypt, desDecrypt.CreateDecryptor(bytesDESKey, bytesDESIV), CryptoStreamMode.Read);
            StreamReader srDecrypt = new StreamReader(csDecrypt);
            string strPlainText = srDecrypt.ReadLine();
            srDecrypt.close();
            csDecrypt.Close();
            msDecrypt.Close();
            return strPlainText;
}
搜索更多相关主题的帖子: public 
2013-12-12 15:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-425111-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047296 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved