Exemplo n.º 1
0
 private void Decrypt_Vigener_Click(object sender, RoutedEventArgs e)
 {
     foreach (Window window in Application.Current.Windows)
     {
         if (window.GetType() == typeof(MainWindow))
         {
             text    = (window as MainWindow).TextBoxOriginal.Text;
             vigener = new Vigener(text, KeyWord.Text);
             (window as MainWindow).TextBoxOriginal.Text = vigener.Decrypt();
         }
     }
 }
        public void Initalize(string text, string key, bool isEncrypting)
        {
            vigener = new Vigener();

            vigener.Key = key;
            KeyParse();

            if (isEncrypting)
            {
                vigener.DecText = text;
                Encrypt();
            }
            else
            {
                vigener.EncText = text;
                Decrypt();
            }

            vigener.isEncrypting = isEncrypting;
        }