惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - FireReprt◇FireScript地带

3ds文件转换为.X文件 [转载]使用SQL直接从sps数据库中恢复文档 SPS恢复问题: [ 提示数据库架构太旧问题 ] 运算符的优先级别 补上一个测试精灵动画的列子 - FireReprt◇FireScript地带 - 博客园 关于CSGL跟FireScript的连接 脚本中类的声明 加入了两个终结符号 - FireReprt◇FireScript地带 - 博客园 脚本支持数组初始化了 - FireReprt◇FireScript地带 - 博客园 IF语句多分支识别 用自定义函数来实现代理类的实例化 测试递归 这是我在C#中测试速度的代码 测试运行效率 加入了静态类的语义分析引擎 FireScript调用DLL和COM FireScript在SharePoint中的应用 识别字符串中的表达式(续二) 识别字符串中的表达式(续一)
MD5加密
FireReprt◇FireScript地带 · 2006-04-30 · via 博客园 - FireReprt◇FireScript地带

C#MD5加密- -

TagMD5加密

也是抄别人的,用起来方便。

 using System.Security.Cryptography;
 using  System.IO; 
 using  System.Text;

///MD5加密
  public string MD5Encrypt(string  pToEncrypt,  string  sKey)
  { 
   DESCryptoServiceProvider  des  =  new  DESCryptoServiceProvider(); 
   byte[]  inputByteArray  =  Encoding.Default.GetBytes(pToEncrypt); 
   des.Key  =  ASCIIEncoding.ASCII.GetBytes(sKey); 
   des.IV  =  ASCIIEncoding.ASCII.GetBytes(sKey); 
   MemoryStream  ms  =  new  MemoryStream(); 
   CryptoStream  cs  =  new  CryptoStream(ms,  des.CreateEncryptor(),CryptoStreamMode.Write); 
   cs.Write(inputByteArray,  0,  inputByteArray.Length); 
   cs.FlushFinalBlock(); 
   StringBuilder  ret  =  new  StringBuilder(); 
   foreach(byte  b  in  ms.ToArray()) 
   { 
    ret.AppendFormat("{0:X2}",  b); 
   } 
   ret.ToString(); 
   return  ret.ToString(); 


  }

  ///MD5解密
  public string MD5Decrypt(string  pToDecrypt,  string  sKey)
  {
   DESCryptoServiceProvider  des  =  new  DESCryptoServiceProvider(); 
 
   byte[]  inputByteArray  =  new  byte[pToDecrypt.Length  /  2]; 
   for(int  x  =  0;  x  <  pToDecrypt.Length  /  2;  x++) 
   { 
    int  i  =  (Convert.ToInt32(pToDecrypt.Substring(x  *  2,  2),  16)); 
    inputByteArray[x]  =  (byte)i; 
   } 
 
   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()); 
  }