Exemplo n.º 1
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];
         }
     }
 }
        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;
        }
Exemplo n.º 3
0
 private void GenKeyButton_Click(object sender, EventArgs e)
 {
     KeyTB.Clear();
     KeyTB.Text = GenericKey();
     byteKey    = Encoding.Default.GetBytes(KeyTB.Text);
 }
Exemplo n.º 4
0
 private void GenKeyButton_Click(object sender, EventArgs e)
 {
     KeyTB.Clear();
     KeyTB.Text = GenericKey();
 }