滴水穿石

点滴记录技术积累历程,共享最新技术。

一种加密算法

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);
            }
          
        }
    }

阅读更多
想对作者说点什么? 我来说一句

NOIP 2012 Vigenère 密码

模拟

chai_jing chai_jing

2016-07-14 12:32:33

阅读数:388

没有更多推荐了,返回首页

不良信息举报

一种加密算法

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭