public void setInformation() { label3.Text = str; // Array.Sort(); label5.Text = getIndex(MyList.Max()).ToString(); jiami jm = new jiami(); label7.Text = jm.Decrypt(str, getIndex(MyList.Max())); label9.Text = MyList.Max().ToString(); }
private void Button3_Click(object sender, EventArgs e) { if (this.flag == 2) { jiami jm = new jiami(); result re = new result("密文为:", CipherText, "解密后的明文为:", jm.Decrypt(this.CipherText, this.Key)); re.ShowDialog(); } else { MessageBox.Show("加密时请勿使用解密操作!", "警告"); } }
private void Button1_Click(object sender, EventArgs e) { double[] arr = new double[26]; int i; for (i = 0; i < 26; i++) { arr[i] = MyList[i]; } Array.Sort(arr); if (Count <= 20) { MessageBox.Show("剩下密钥概率过低,拒绝访问!", "提示"); } else { label5.Text = getIndex(arr[Count - 1]).ToString(); jiami jm = new jiami(); label7.Text = jm.Decrypt(str, getIndex(arr[Count - 1])); label9.Text = arr[Count - 1].ToString(); Count--; } }
public void init() { jiami jm = new jiami(); label2.Text = jm.Decrypt(this.mw, 0); label4.Text = jm.Decrypt(this.mw, 1); label6.Text = jm.Decrypt(this.mw, 2); label8.Text = jm.Decrypt(this.mw, 3); label10.Text = jm.Decrypt(this.mw, 4); label12.Text = jm.Decrypt(this.mw, 5); label14.Text = jm.Decrypt(this.mw, 6); label16.Text = jm.Decrypt(this.mw, 7); label18.Text = jm.Decrypt(this.mw, 8); label20.Text = jm.Decrypt(this.mw, 9); label22.Text = jm.Decrypt(this.mw, 10); label24.Text = jm.Decrypt(this.mw, 11); label26.Text = jm.Decrypt(this.mw, 12); label28.Text = jm.Decrypt(this.mw, 13); label30.Text = jm.Decrypt(this.mw, 14); label32.Text = jm.Decrypt(this.mw, 15); label34.Text = jm.Decrypt(this.mw, 16); label36.Text = jm.Decrypt(this.mw, 17); label38.Text = jm.Decrypt(this.mw, 18); label40.Text = jm.Decrypt(this.mw, 19); label42.Text = jm.Decrypt(this.mw, 20); label44.Text = jm.Decrypt(this.mw, 21); label46.Text = jm.Decrypt(this.mw, 22); label48.Text = jm.Decrypt(this.mw, 23); label50.Text = jm.Decrypt(this.mw, 24); label52.Text = jm.Decrypt(this.mw, 25); }