コード例 #1
0
 private void KeyTB_Click(object sender, EventArgs e)
 {
     if (KeyTB.Text == "<Введите ключ>")
     {
         KeyTB.ResetText();
         KeyTB.ForeColor = Color.Black;
     }
 }
コード例 #2
0
 private void GenKeyButton_Click(object sender, EventArgs e)
 {
     KeyTB.Clear();
     while (KeyTB.TextLength != 32)
     {
         Algorithm_AES.AlgorithmAES aes = new Algorithm_AES.AlgorithmAES();
         byte[] key = aes.GenerateKey();
         for (int i = 0; i < key.Length; i++)
         {
             KeyTB.Text += (char)key[i];
         }
     }
 }
コード例 #3
0
        private void keyGenerateButton_Click(object sender, EventArgs e)
        {
            KeyTB.Clear();
            OutputRichTextBox.Clear();
            byte[] GenerateKey = new byte[32];
            Random RandomNumb  = new Random();

            for (int i = 0; i < GenerateKey.Length; i++)
            {
                GenerateKey[i] = (byte)RandomNumb.Next(0, 255);
                KeyTB.Text    += (char)GenerateKey[i];
            }
            byteKey = GenerateKey;
        }
コード例 #4
0
 private void GenKeyButton_Click(object sender, EventArgs e)
 {
     KeyTB.Clear();
     KeyTB.Text = GenericKey();
     byteKey    = Encoding.Default.GetBytes(KeyTB.Text);
 }
コード例 #5
0
 private void GenKeyButton_Click(object sender, EventArgs e)
 {
     KeyTB.Clear();
     KeyTB.Text = GenericKey();
 }