Generated Image

三六七超市管理系统2007日用品版注册机的实现

算法根据KuNgBiM

http://bbs.pediy.com/showthread.php?threadid=40987

分析得出

 

【算法总结】
  密码表计算式:
  LCase(MD5(LCase(MD5(用户名+“spadger”))))
  注册码段计算式:
  A:Mid(密码表,5)
  B:Mid(密码表,5,5)
  C:Mid(密码表,10,5)
  D:Mid(密码表,15,5)
  注册码组合方式:A-B-C-D

 

稍微做了下

 

  private void button1_Click(object sender, EventArgs e)
        {
 
            string UserName;
            UserName = textBox1.Text + "spadger";
 
            byte[] result1 = Encoding.Default.GetBytes(UserName); 
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] output1 = md5.ComputeHash(result1);
         
            string i = BitConverter.ToString(output1).Replace("-", "").ToLower();
        
 
            byte[] result2 = Encoding.Default.GetBytes(i);
            byte[] output2 = md5.ComputeHash(result2);
 
 
            string j = BitConverter.ToString(output2).Replace("-", "").ToLower();
      
            string key1, key2, key3, key4;
            key1 = j.Substring (0, 5);
            key2 = j.Substring(4, 5);
            key3 = j.Substring(9, 5);
            key4=j.Substring(14, 5);
            if (textBox1.Text.Trim() == "")
            {
                MessageBox.Show("写上用户名");
            }
            else
            {
                textBox2.Text = key1 + "-" + key2 + "-" + key3 + "-" + key4;
            }
        }

使用了MD5加密

全当学习了下如何使用MD5这个类啦

公司的名称:guiyuan

注册码为:5dd06-6172e-c76e0-8fc7f

posted @ 2007-03-16 18:52  桂圆  阅读(616)  评论(0编辑  收藏  举报