private void Encrypt() { try { if (Validate(true)) { var ciphertext = DES.Encrypt( PlainText.FromHexStringToBitArray(), Key.FromHexStringToBitArray()); CipherText = ciphertext.ToHexString(); } } catch (Exception e) { ShowMessage(string.Format("Error: {0}", e)); } }