首页
社区
课程
招聘
[求助]请问这个是什么算法?
2015-2-6 14:25 3651

[求助]请问这个是什么算法?

2015-2-6 14:25
3651
1c16041114045a5d434755040c13071e12594d451b121613104542575f475a55485d565f0f0b090b175a88dfd58cc7fe83d3cc90f0d021368bf6c38cced38eeddb9ff4c597d9ca96f8f590cdc88ac8c1180406021c4e454a4b0c1b3f224a1804000e0003160d450c1b2d1c13014541550c4045051c45510a444e541944510b4344514843025a4411514e43515f4a

public static string Decstring(string str, string key)
{
    if ("" == str)
    {
        return "";
    }
    if ("" == key)
    {
        key = "nswdxpg";
    }
    byte[] bytes = Encoding.UTF8.GetBytes(str.Trim());
    int length = bytes.Length;
    int num2 = key.Length;
    int num3 = 0;
    int num4 = 0;
    List<byte> list = new List<byte>();
    for (int i = 0; i < length; i += 2)
    {
        num4 = Convert.ToInt16(string.Format("{0}{1}", Convert.ToChar(bytes[i]), Convert.ToChar(bytes[i + 1])), 0x10) ^ Convert.ToInt16(key[num3]);
        list.Add((byte) num4);
        num3 = (num3 + 1) % num2;
    }
    byte[] buffer2 = list.ToArray();
    return Encoding.UTF8.GetString(buffer2);

public static string Encstring(string str, string key)
{
    if ("" == str)
    {
        return "";
    }
    if ("" == key)
    {
        key = "nswdxpg";
    }
    byte[] bytes = Encoding.UTF8.GetBytes(str);
    int length = bytes.Length;
    int num2 = key.Length;
    int num3 = 0;
    string str3 = "";
    for (int i = 0; i < length; i++)
    {
        str3 = str3 + Convert.ToString((int) (Convert.ToInt32(bytes[i]) ^ Convert.ToInt32(key[num3])), 0x10).PadLeft(2, '0');
        num3 = (num3 + 1) % num2;
    }
    return str3;
}

[培训]科锐软件逆向50期预科班报名即将截止,速来!!! 50期正式班报名火爆招生中!!!

收藏
免费 0
打赏
分享
最新回复 (1)
雪    币: 2
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
huang跃 2015-2-9 19:58
2
0
看到异或相关的东西
游客
登录 | 注册 方可回帖
返回