Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     byte[] clc             = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox1.Text, " ");
     WFNetLib.lcyHashCal hc = new WFNetLib.lcyHashCal();
     byte[] ret             = hc.HashCal(clc, (int)numericUpDown1.Value);
     textBox2.Text = WFNetLib.StringFunc.StringsFunction.byteToHexStr(ret, " ");
 }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            byte[] clc             = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox3.Text, " ");
            byte[] ret             = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox5.Text, " ");
            WFNetLib.lcyHashCal hc = new WFNetLib.lcyHashCal();
            bool bok = false;

            for (int i = 0; i < 200000; i++)
            {
                clc = hc.HashCal(clc);
                bok = true;
                for (int j = 0; j < 8; j++)
                {
                    if (clc[j] != ret[j])
                    {
                        bok = false;
                        break;
                    }
                }
                if (bok)
                {
                    textBox4.Text = (i + 1).ToString();
                    return;
                }
            }
            textBox4.Text = "没找到";
        }
Beispiel #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     byte[] psw     = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox1.Text, " ");
     byte[] rx      = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox2.Text, " ");
     byte[] step    = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox3.Text, " ");
     byte[] curHash = WFNetLib.StringFunc.StringsFunction.strToHexByte(textBox6.Text, " ");
     byte[] ret     = new byte[8];
     for (int i = 0; i < 8; i++)
     {
         ret[i] = (byte)(psw[i] ^ rx[i]);
     }
     for (int i = 0; i < 4; i++)
     {
         ret[i + 4] = (byte)(ret[4 + i] ^ step[i]);
     }
     WFNetLib.lcyHashCal hashCal = new WFNetLib.lcyHashCal();
     for (int i = 0; i < 8; i++)
     {
         hashCal.HashIn[i] = ret[i];
     }
     hashCal.HashOnce();
     textBox4.Text = WFNetLib.StringFunc.StringsFunction.byteToHexStr(hashCal.HashOut, " ");
     for (int i = 0; i < 8; i++)
     {
         ret[i] = (byte)(hashCal.HashOut[i] ^ curHash[i]);
     }
     textBox5.Text = WFNetLib.StringFunc.StringsFunction.byteToHexStr(ret, " ");
 }