小伟

小伟

 

2011年11月14日

RSA签名 和 RSA加密解密

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Security.Cryptography;//引入命名空间//我们使用公钥加密(不对称加密)来实现注册码的算法。 //公钥加密使用一个必须对未经授权的用户保密的私钥和一个可以对任何人公开的公钥。//公钥和私钥都在数学上相关联;用公钥加密的数据只能用私钥解密 阅读全文

posted @ 2011-11-14 13:41 旋风 阅读(1682) 评论(2) 推荐(0)

DES加解密

摘要: /// <summary> /// DES加密 /// </summary> /// <param name="data"></param> /// <param name="key"></param> /// <param name="iv"></param> public static string DesEncode(string data, string key, string iv) { byte[] byKey = System 阅读全文

posted @ 2011-11-14 11:56 旋风 阅读(176) 评论(0) 推荐(0)

http.post方法传递数据

摘要: //接收数据Request.Form["data"] //处理接收的数据 private void UpdateInfoAction(string lc, string Data, LogistiCorpObject logistiCorpObject, string checkId) { try { //状态处理 var updateInfo = (UpdateInfo)XmlUtil.Deserialize(typeof(UpdateInfo), lcData); if (updateInfo == null) { //xml解析错误 string backValue 阅读全文

posted @ 2011-11-14 10:09 旋风 阅读(753) 评论(0) 推荐(0)

MD5加密方法

摘要: //传进要加密的字符串,返回一个MD5串,然后进行对比 public static String GetMD5Str(String info) { try { byte[] res = System.Text.Encoding.Default.GetBytes(info); MD5CryptoServiceProvider md = new MD5CryptoServiceProvider(); byte[] result = md.ComputeHash(res); byte[] hash = md.ComputeHash(result); StringBuilder sbuilder = 阅读全文

posted @ 2011-11-14 09:29 旋风 阅读(153) 评论(0) 推荐(0)

导航