static void Main(string[] args) { Playfair szyfr = new Playfair("klucz"); szyfr.show(); Console.ReadKey(); }
void TextBoxKeywordTextChanged(object sender, EventArgs e) { this.pf = new Playfair.Playfair(this.textBoxKeyword.Text); if (cipher && !String.IsNullOrEmpty(this.textBoxCipher.Text)) { this.textBoxDecipher.Text = this.pf.Cipher(this.textBoxCipher.Text); } else if (!cipher && !String.IsNullOrEmpty(this.textBoxDecipher.Text)) { this.textBoxCipher.Text = this.pf.Decipher(this.textBoxDecipher.Text); } }
static void Main(string[] args) { string originalText = "A fost odata ca niciodata un mare rege"; Console.WriteLine(originalText); string plainText = Playfair.Prepare(originalText); Console.WriteLine(plainText); //Exemplu de key de pe wikipedia string key = "playfirexmbcdghknoqstuvwz"; string cipherText = Playfair.Encipher(key, plainText); Console.WriteLine(cipherText); plainText = Playfair.Decipher(key, cipherText); Console.WriteLine(plainText); Console.ReadKey(); }