Criptografia
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms;
namespace CriptografiaMD5
{
static class Program {
[STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new CriptografiaMD5()); } }
}
CriptografiaMD5.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
namespace CriptografiaMD5
{
public partial class CriptografiaMD5 : Form { public CriptografiaMD5() { InitializeComponent(); }
private void bt_Encrypt_Click(object sender, EventArgs e) { txtResultCrypt.Text = MD5Crypt.Criptografar(txtToCript.Text); }
private void bt_Decrypt_Click(object sender, EventArgs e) { try { txtResultDecrypt.Text = MD5Crypt.Descriptografar(txtToCript.Text); } catch { MessageBox.Show("O valor informado para Decriptação é inválido.", "Encrypt"); } } }
}
CriptografiaMD5
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{D1CEF8F1-5000-45F1-976C-954BED5BC08E}</ProjectGuid> <OutputType>WinExe</OutputType>