62,243
社区成员




using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Web.Configuration;
using System.Web.Security;
/// <summary>
/// HanShu 的摘要说明
/// </summary>
public class jami
{
public jami() { }
public static string DecryptDBStr(string Text, string sKey) // 【验证=8】
{
return MachineKeySection.ByteArrayToHexString(algorithm.ComputeHash(Encoding.UTF8.GetBytes(password)), 0);
}
}
/// <summary>
/// 字节数组转换为16进制表示的字符串
/// </summary>
public static string ByteArrayToHexString(byte[] buf)
{
int iLen = 0;
// 通过反射获取 MachineKeySection 中的 ByteArrayToHexString 方法,该方法用于将字节数组转换为16进制表示的字符串。
Type type = typeof(System.Web.Configuration.MachineKeySection);
MethodInfo byteArrayToHexString = type.GetMethod("ByteArrayToHexString", BindingFlags.Static | BindingFlags.NonPublic);
// 字节数组转换为16进制表示的字符串
return (string)byteArrayToHexString.Invoke(null, new object[] { buf, iLen });
}