Exemplo n.º 1
0
 private void BtnDecrypt_Click(object sender, RoutedEventArgs e)
 {
     if (tbPassword.Text.Length < 5)
     {
         MessageBox.Show("密码长度不能低于5位");
         return;
     }
     AesHelp.GenKeyIV(tbPassword.Text, out key, out iv);
     //解密
     byte[] data = Convert.FromBase64String(this.tbEncrypt.Text);
     this.tbDecrypt.Text = AesHelp.DecryptString(data, key, iv);
 }