其中MD5演算法返回Int的ToString字串

2021-04-18 02:39:09 字數 1653 閱讀 1908

.net框架由於擁有clr提供的豐富庫支援,只需很少的**即可實現先前使用c等舊式語言很難實現的加密演算法。本類實現一些常用機密演算法,供參考。其中md5演算法返回int的tostring字串。  

using   system;  

using   system.io;  

using   system.data;  

using   system.text;  

using   system.diagnostics;  

using   system.security;  

using   system.security.cryptography;  

namespace   com.quickline.encrypt  

private   string   getstrin(string   strin)  

if   (iscasesensitive   ==   false)  

return   strin;  

}  

public   string   md5encrypt(string   strin)  

public   string   sha1encrypt(string   strin)  

public   string   sha256encrypt(string   strin)  

public   string   sha512encrypt(string   strin)  

///  

///   使用des加密(added   by   niehl   2005-4-6)  

///  

///   待加密的字串

///   金鑰(最大長度8)

///   初始化向量(最大長度8)

///   加密後的字串

public   string   desencrypt(string   originalvalue,string   key,string   iv)  

public   string   desencrypt(string   originalvalue,string   key)  

///  

///   使用des解密(added   by   niehl   2005-4-6)  

///  

///   待解密的字串

///   金鑰(最大長度8)

///   m初始化向量(最大長度8)

///   解密後的字串

public   string   desdecrypt(string   encryptedvalue,string   key,string   iv)  

public   string   desdecrypt(string   encryptedvalue,string   key)  

private   string   getstringvalue(byte   byte)  

else  

}  

return   tmpstring;  

}  

private   byte   getkeybytearray(string   strkey)  

}  

}

MD5演算法 加密

ps 在開發的某些業務中,涉及到一些明文不太安全的時候會用到加密演算法,常用的一般有md5加密 des aes 等加密方式這裡自己了解了一下md5加密。1 md5演算法加密 也就是 資訊 摘要演算法5 就是把乙個任意長度的位元組串變換成一定長的十六進製制數字串 public static strin...

MD5演算法實現

md5.h ifndef md5 h define md5 h typedef struct md5 ctx 非線性輔助函式 define f x,y,z x y x z define g x,y,z x z y z define h x,y,z x y z define i x,y,z y x z...

MD5演算法實現

md5.h ifndef md5 h define md5 h typedef struct md5 ctx 非線性輔助函式 define f x,y,z x y x z define g x,y,z x z y z define h x,y,z x y z define i x,y,z y x z...