private void ButtonEncrypt_Click(object sender, EventArgs e) { if (textBoxEncryptOriginal.TextLength == 0) { return; } var encrypt = chiper.Encrypt(textBoxEncryptOriginal.Text, textBoxKey.Text); textBoxEncrypt.Text = encrypt; }
static void Main(string[] args) { StreamReader sr = new StreamReader("message.txt"); var message = sr.ReadToEnd(); sr.Close(); string encrypted = PolybiusSquare.Encrypt(message); string decrypted = PolybiusSquare.Decrypt(encrypted); StreamWriter sw = new StreamWriter("output.txt"); sw.WriteLine(decrypted); sw.Close(); System.Console.WriteLine((int)Math.Sqrt(120) + 1); // Console.WriteLine(encrypted); }