private void KeyTB_Click(object sender, EventArgs e) { if (KeyTB.Text == "<Введите ключ>") { KeyTB.ResetText(); KeyTB.ForeColor = Color.Black; } }
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; }
private void GenKeyButton_Click(object sender, EventArgs e) { KeyTB.Clear(); KeyTB.Text = GenericKey(); byteKey = Encoding.Default.GetBytes(KeyTB.Text); }
private void GenKeyButton_Click(object sender, EventArgs e) { KeyTB.Clear(); KeyTB.Text = GenericKey(); }