using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Nutqq;
namespace QQencrypt
{
public partial class Form1 : Form
{
private Crypter QQCrypter = new Crypter();
public Form1()
{
InitializeComponent();
}
private void buttonEncrypt_Click(object sender, EventArgs e)
{
try
{
byte[] source = ASCIIEncoding.ASCII.GetBytes(textBoxSource.Text);
byte[] key = ASCIIEncoding.ASCII.GetBytes(textBoxKey.Text);
byte[] Encrypt = QQCrypter.encrypt(source, key);
textBoxEncrypt.Text = ASCIIEncoding.ASCII.GetString(Encrypt);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void buttonDecrypt_Click(object sender, EventArgs e)
{
try
{
byte[] Encrypt = ASCIIEncoding.ASCII.GetBytes(textBoxEncrypt.Text);
byte[] Decrypt = QQCrypter.decrypt(Encrypt,ASCIIEncoding.ASCII.GetBytes(textBoxKey.Text));
textBoxDecrypt.Text = ASCIIEncoding.ASCII.GetString(Decrypt);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}