28
2015
06

【C#、Asp.Net 工具类大全】加密解密工具类

使用实例:

private string urlPath = "";

protected void Page_Load(object sender, EventArgs e)

{

    if (!Page.IsPostBack)

    { 

        urlPath = Server.MapPath("~/file/");

        encryptInfo();

    }

}

/// <summary>

/// 字符串加密解密

/// </summary>

11
2013
03

标准的DES加密、解密类

   public class CryptoUtil

   {

       //随机选8个字节既为密钥也为初始向量

       private static byte[] KEY_64 = { 42, 16, 93, 156, 78, 4, 218, 32 };

       private static byte[] IV_64 = { 55, 103, 246, 79, 36, 99, 167, 3 };

12
2012
04

C# 加密算法的方法,解密算法的方法

//加密算法的方法
const string KEY_64 = "VavicApp";//注意了,是8个字符,64位
const string IV_64 = "VavicApp";
public string Encode(string data)
{
byte[] byKey = System.Text.ASCIIEncoding.ASCII.GetBytes(KEY_64);
byte[] byIV = System.Text.ASCIIEncoding.ASCII.GetBytes(IV_64);
...
«1»