原文:
c#進行md5加密方式和解密演算法
--------------- 因為加密個解密都需要用到key所有在加密的後需要把key和加密碼都存到資料庫中
///
/// 唯一加密方式
///
///
///
public static string weijiamiguid(string texts)
------------------------取出加密時存在資料庫的加密碼和key
///
/// 唯一解密方式
///
///
///
public static string weiyijiemiguid(string texts)
); //分割一下 然後調解密
return gxc.commonality.commguid.md5decrypt(pwa[0], pwa[1]);
///
/// 建立key
///
///
public static string generatekey()
///
/// md5加密
///
///
///
///
///
/// md5解密
///
///
///
///
public static string md5decrypt(string ptodecrypt, string skey)
des.key = asciiencoding.ascii.getbytes(skey);
des.iv = asciiencoding.ascii.getbytes(skey);
memorystream ms = new memorystream();
cryptostream cs = new cryptostream(ms, des.createdecryptor(), cryptostreammode.write);
cs.write(inputbytearray, 0, inputbytearray.length);
cs.flushfinalblock();
stringbuilder ret = new stringbuilder();
return system.text.encoding.default.getstring(ms.toarray());
}複製就可以用 無需改動 16位加密方式
MD5加密解密
using system using system.text using system.io using system.security.cryptography class class1 txtkey txtiv kl7zgtm1dvq 設定加密iv btnivgen console.writel...
MD5加密解密
using system using system.text using system.io using system.security.cryptography class class1 txtkey txtiv kl7zgtm1dvq 設定加密iv btnivgen console.writel...
MD5加密解密
protected void page load object sender,eventargs e s0 console.writeline 加密 s1 console.writeline 解密 s2 md5解密 public string md5decrypt string ptodecrypt...