示例#1
0
        private void btnEncrypt_Click(object sender, EventArgs e)
        {
            tbKeyseq1.Text        = VernamCipher.GenerateKeyseq(tbOpenText.Text.Length);
            tbEncryptedText1.Text = VernamCipher.Encrypt(tbOpenText.Text, tbKeyseq1.Text);

            tbKeyseq2.Text        = tbKeyseq1.Text;
            tbEncryptedText2.Text = tbEncryptedText1.Text;
        }
示例#2
0
 private void btnDecrypt_Click(object sender, EventArgs e)
 {
     tbDecryptedText.Text = VernamCipher.Decrypt(tbEncryptedText2.Text, tbKeyseq2.Text);
 }