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