亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? form1.cs

?? 本程序通過混合光學雙穩模型的迭代方程對多媒體文件進行混沌加密、解密(加密解密文件分別以.en和.de結尾)
?? CS
字號:
using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace 混沌密碼加密
{
	/// <summary>
	/// Form1 的摘要說明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.GroupBox groupBox4;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox tbxKey;
		private System.Windows.Forms.Button btnSelect;
		private System.Windows.Forms.Button btnEncrypt;
		private System.Windows.Forms.Button btnDecrypt;
		private System.Windows.Forms.PictureBox pbOriginal;
		private System.Windows.Forms.PictureBox pbEncrypted;
		private System.Windows.Forms.PictureBox pbDecrypted;
		private System.Windows.Forms.OpenFileDialog openFileDialog;

		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		/// 
		private double x;
		private const double xb=2.5;
		private const int A=4;
		private string bmpFileName;
		private const int headNum=118;
		private const string fileEnSuffix=".en";
		private const string fileDeSuffix=".de";
		private System.Windows.Forms.Button bnClear;
		private System.ComponentModel.Container components = null;
		

		public Form1()
		{
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
			//
			
		}

		/// <summary>
		/// 清理所有正在使用的資源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗體設計器生成的代碼
		/// <summary>
		/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
		/// 此方法的內容。
		/// </summary>
		private void InitializeComponent()
		{
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.groupBox4 = new System.Windows.Forms.GroupBox();
			this.label1 = new System.Windows.Forms.Label();
			this.tbxKey = new System.Windows.Forms.TextBox();
			this.btnSelect = new System.Windows.Forms.Button();
			this.btnEncrypt = new System.Windows.Forms.Button();
			this.btnDecrypt = new System.Windows.Forms.Button();
			this.pbOriginal = new System.Windows.Forms.PictureBox();
			this.pbEncrypted = new System.Windows.Forms.PictureBox();
			this.pbDecrypted = new System.Windows.Forms.PictureBox();
			this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
			this.bnClear = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.groupBox3.SuspendLayout();
			this.groupBox4.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.bnClear);
			this.groupBox1.Controls.Add(this.tbxKey);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Location = new System.Drawing.Point(0, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(920, 56);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.pbOriginal);
			this.groupBox2.Controls.Add(this.btnSelect);
			this.groupBox2.Location = new System.Drawing.Point(0, 64);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(304, 304);
			this.groupBox2.TabIndex = 1;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "原文件";
			// 
			// groupBox3
			// 
			this.groupBox3.Controls.Add(this.pbEncrypted);
			this.groupBox3.Controls.Add(this.btnEncrypt);
			this.groupBox3.Location = new System.Drawing.Point(312, 64);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new System.Drawing.Size(304, 304);
			this.groupBox3.TabIndex = 2;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "加密文件";
			// 
			// groupBox4
			// 
			this.groupBox4.Controls.Add(this.pbDecrypted);
			this.groupBox4.Controls.Add(this.btnDecrypt);
			this.groupBox4.Location = new System.Drawing.Point(624, 64);
			this.groupBox4.Name = "groupBox4";
			this.groupBox4.Size = new System.Drawing.Size(304, 304);
			this.groupBox4.TabIndex = 3;
			this.groupBox4.TabStop = false;
			this.groupBox4.Text = "解密文件";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(53, 23);
			this.label1.TabIndex = 0;
			this.label1.Text = "密鑰:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// tbxKey
			// 
			this.tbxKey.Location = new System.Drawing.Point(56, 17);
			this.tbxKey.Name = "tbxKey";
			this.tbxKey.TabIndex = 1;
			this.tbxKey.Text = "3";
			// 
			// btnSelect
			// 
			this.btnSelect.Location = new System.Drawing.Point(115, 17);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.TabIndex = 0;
			this.btnSelect.Text = "選擇文件";
			this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
			// 
			// btnEncrypt
			// 
			this.btnEncrypt.Location = new System.Drawing.Point(115, 16);
			this.btnEncrypt.Name = "btnEncrypt";
			this.btnEncrypt.TabIndex = 0;
			this.btnEncrypt.Text = "加密";
			this.btnEncrypt.Click += new System.EventHandler(this.btnEncrypt_Click);
			// 
			// btnDecrypt
			// 
			this.btnDecrypt.Location = new System.Drawing.Point(115, 16);
			this.btnDecrypt.Name = "btnDecrypt";
			this.btnDecrypt.TabIndex = 0;
			this.btnDecrypt.Text = "解密";
			this.btnDecrypt.Click += new System.EventHandler(this.btnDecrypt_Click);
			// 
			// pbOriginal
			// 
			this.pbOriginal.Location = new System.Drawing.Point(8, 56);
			this.pbOriginal.Name = "pbOriginal";
			this.pbOriginal.Size = new System.Drawing.Size(288, 232);
			this.pbOriginal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
			this.pbOriginal.TabIndex = 1;
			this.pbOriginal.TabStop = false;
			// 
			// pbEncrypted
			// 
			this.pbEncrypted.Location = new System.Drawing.Point(8, 56);
			this.pbEncrypted.Name = "pbEncrypted";
			this.pbEncrypted.Size = new System.Drawing.Size(288, 232);
			this.pbEncrypted.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
			this.pbEncrypted.TabIndex = 2;
			this.pbEncrypted.TabStop = false;
			// 
			// pbDecrypted
			// 
			this.pbDecrypted.Location = new System.Drawing.Point(8, 56);
			this.pbDecrypted.Name = "pbDecrypted";
			this.pbDecrypted.Size = new System.Drawing.Size(288, 232);
			this.pbDecrypted.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
			this.pbDecrypted.TabIndex = 2;
			this.pbDecrypted.TabStop = false;
			// 
			// bnClear
			// 
			this.bnClear.Location = new System.Drawing.Point(832, 16);
			this.bnClear.Name = "bnClear";
			this.bnClear.TabIndex = 2;
			this.bnClear.Text = "清空";
			this.bnClear.Visible = false;
			this.bnClear.Click += new System.EventHandler(this.bnClear_Click);
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(928, 373);
			this.Controls.Add(this.groupBox4);
			this.Controls.Add(this.groupBox3);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.Name = "Form1";
			this.Text = "采用混合光學雙穩模型對多媒體文件加密";
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox4.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 應用程序的主入口點。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void btnSelect_Click(object sender, System.EventArgs e)
		{
			this.openFileDialog.Filter="位圖文件(*.bmp)|*.bmp";
			this.openFileDialog.Title="打開文件";
			if(this.openFileDialog.ShowDialog()!=DialogResult.Cancel)
			{
				Bitmap bmp=new Bitmap(this.openFileDialog.FileName);
				bmpFileName=this.openFileDialog.FileName;
				this.pbOriginal.Image=bmp;
				this.pbOriginal.Refresh();

				if(this.pbEncrypted.Image!=null)
				{
					this.pbEncrypted.Image.Dispose();
					this.pbEncrypted.Image=null;
					this.pbEncrypted.Refresh();
				}
				if(this.pbDecrypted.Image!=null)
				{
					this.pbDecrypted.Image.Dispose();
					this.pbDecrypted.Image=null;
					this.pbDecrypted.Refresh();
				}
			}

		}

		private byte Generate8K()
		{
			string str="";
			for(int i=0;i<8;i++)
			{
				x=A*Math.Pow(Math.Sin(x-xb),2);
				if(x>(2.0/3.0)*A)
					str+="1";
				else 
					str+="0";
			}
			return Convert.ToByte(str,2);
		}

		private void btnEncrypt_Click(object sender, System.EventArgs e)
		{
			if(this.pbEncrypted.Image!=null)
				this.pbEncrypted.Image.Dispose();
			if(this.pbDecrypted.Image!=null)
			{
				this.pbDecrypted.Image.Dispose();
				this.pbDecrypted.Image=null;
				this.pbDecrypted.Refresh();
			}

			FileStream fsToWrite = new FileStream(bmpFileName+fileEnSuffix, FileMode.Create);
			// Create the writer for data.
			BinaryWriter w = new BinaryWriter(fsToWrite);

			FileStream fs=new FileStream(this.bmpFileName,FileMode.Open,FileAccess.Read);
			BinaryReader r = new BinaryReader(fs);

			//去除文件頭
			for(int i=0;i<headNum;i++)
			{
				w.Write(r.ReadByte());
			}

			//對數據段加密
			x=Convert.ToDouble(this.tbxKey.Text);
			try
			{
				while(true)
				{
					byte code=Convert.ToByte(r.ReadByte()^this.Generate8K());
					w.Write(code);
					//w.Write(r.ReadByte());
				}
			}
			catch(EndOfStreamException)
			{
			}
			finally
			{
				w.Close();
				r.Close();
				fsToWrite.Close();
				fs.Close();
			}
			//打開加密文件
			Bitmap bmp=new Bitmap(bmpFileName+fileEnSuffix);
			this.pbEncrypted.Image=bmp;
			this.pbEncrypted.Refresh();
		}

		private void btnDecrypt_Click(object sender, System.EventArgs e)
		{
			if(this.pbDecrypted.Image!=null)
			{
				this.pbDecrypted.Image.Dispose();
				
			}
			
			FileStream fsToWrite = new FileStream(bmpFileName+fileDeSuffix, FileMode.Create);
			// Create the writer for data.
			BinaryWriter w = new BinaryWriter(fsToWrite);

			FileStream fs=new FileStream(this.bmpFileName+fileEnSuffix,FileMode.Open,FileAccess.Read);
			BinaryReader r = new BinaryReader(fs);

			//去除文件頭
			for(int i=0;i<headNum;i++)
			{
				w.Write(r.ReadByte());
			}

			//對數據段加密
			x=Convert.ToDouble(this.tbxKey.Text);
			try
			{
				while(true)
				{
					byte code=Convert.ToByte(r.ReadByte()^this.Generate8K());
					w.Write(code);
					//w.Write(r.ReadByte());
				}
			}
			catch(EndOfStreamException)
			{
			}
			finally
			{
				w.Close();
				r.Close();
				fsToWrite.Close();
				fs.Close();
			}
			//打開加密文件
			Bitmap bmp=new Bitmap(bmpFileName+fileDeSuffix);
			this.pbDecrypted.Image=bmp;
			this.pbDecrypted.Refresh();
		}

		private void bnClear_Click(object sender, System.EventArgs e)
		{

			
			this.pbOriginal.Image.Dispose();
			this.pbEncrypted.Image.Dispose();
			this.pbDecrypted.Image.Dispose();

			//this.Refresh();
			this.pbOriginal.Image=null;
			this.pbEncrypted.Image=null;
			this.pbDecrypted.Image=null;

			this.pbOriginal.Refresh();
			this.pbEncrypted.Refresh();
			this.pbDecrypted.Refresh();
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久久久久漫画| 最近日韩中文字幕| 欧美激情艳妇裸体舞| 亚洲一区二区三区中文字幕| 国产精品资源网站| 欧美老肥妇做.爰bbww视频| 国产午夜精品在线观看| 亚洲成a人片在线不卡一二三区| 国产一区二区三区免费看| 欧美最猛性xxxxx直播| 久久精品夜色噜噜亚洲aⅴ| 亚洲图片有声小说| 97久久精品人人做人人爽| 久久影音资源网| 亚洲v日本v欧美v久久精品| 99视频国产精品| 欧美激情在线看| 国产一区二区三区免费看| 日韩美女天天操| 日本欧美加勒比视频| 欧美午夜寂寞影院| 亚洲另类在线一区| 91猫先生在线| 亚洲免费观看高清完整版在线观看| 国产精品一区二区在线看| 2021久久国产精品不只是精品| 日韩在线卡一卡二| 欧美丰满少妇xxxxx高潮对白| 夜夜嗨av一区二区三区| 91免费视频网址| 亚洲激情av在线| 91女厕偷拍女厕偷拍高清| 17c精品麻豆一区二区免费| 成人国产在线观看| 中文字幕的久久| 成人毛片在线观看| 中文字幕一区在线| 色先锋久久av资源部| 亚洲裸体xxx| 色综合中文字幕国产 | 欧美第一区第二区| 另类中文字幕网| 久久这里都是精品| voyeur盗摄精品| 亚洲色欲色欲www| 欧洲人成人精品| 五月天亚洲精品| 91精品国产综合久久久久久漫画 | 欧美性高清videossexo| 亚洲一区二区三区在线| 欧美日本一道本| 国产一区久久久| 亚洲欧洲av一区二区三区久久| www.欧美日韩| 亚洲18影院在线观看| 精品卡一卡二卡三卡四在线| 国产一区二区三区在线观看免费视频| 日本一区二区不卡视频| 一本色道久久综合精品竹菊| 亚洲国产精品人人做人人爽| 日韩午夜中文字幕| 成人国产电影网| 亚洲成a人v欧美综合天堂下载 | 色8久久精品久久久久久蜜| 性做久久久久久久免费看| 精品粉嫩超白一线天av| 99久久伊人精品| 日本网站在线观看一区二区三区| 久久视频一区二区| 欧美亚洲综合另类| 国产精品1区二区.| 亚洲成av人片一区二区梦乃| 亚洲精品一线二线三线无人区| 91免费看片在线观看| 精品影视av免费| 亚洲激情图片小说视频| 亚洲精品一区二区三区99| 色婷婷精品久久二区二区蜜臂av| 韩国av一区二区三区四区| 一区二区免费在线播放| 久久久精品一品道一区| 欧美另类z0zxhd电影| 91亚洲国产成人精品一区二区三 | 亚洲欧洲色图综合| 欧美一区中文字幕| 一本大道综合伊人精品热热 | 精品国产网站在线观看| 色欧美片视频在线观看| 成人性生交大片免费看中文 | 狠狠色丁香久久婷婷综| 午夜视频一区二区三区| 自拍偷在线精品自拍偷无码专区| 精品久久久三级丝袜| 欧美色精品天天在线观看视频| 成人精品国产福利| 国产美女在线观看一区| 麻豆精品蜜桃视频网站| 性做久久久久久免费观看| 亚洲欧洲综合另类| 国产精品久久久久一区| 国产亚洲精品超碰| 精品裸体舞一区二区三区| 欧美乱熟臀69xxxxxx| 欧美性三三影院| 色av综合在线| 色94色欧美sute亚洲线路二| 99精品在线观看视频| 粉嫩高潮美女一区二区三区| 国产在线精品一区二区夜色 | 久久99精品久久只有精品| 亚洲成a人v欧美综合天堂下载| 亚洲综合在线观看视频| 亚洲综合色丁香婷婷六月图片| 亚洲乱码国产乱码精品精可以看 | 国产不卡高清在线观看视频| 久久黄色级2电影| 麻豆高清免费国产一区| 久久精品国产**网站演员| 蜜臀av一级做a爰片久久| 麻豆高清免费国产一区| 久久99精品久久久久久国产越南| 毛片一区二区三区| 国产精品自拍av| 成人禁用看黄a在线| 色综合天天综合网天天看片| 97精品国产露脸对白| 91久久线看在观草草青青| 一本久久a久久免费精品不卡| 91国偷自产一区二区开放时间 | 日韩三级精品电影久久久 | 美国精品在线观看| 极品瑜伽女神91| 大白屁股一区二区视频| 91香蕉视频mp4| 欧美日韩亚洲综合一区二区三区| 欧美精品在线观看播放| 精品日本一线二线三线不卡| 久久精品一区二区三区四区| 一区视频在线播放| 亚洲成人av一区二区三区| 免费在线视频一区| 成人免费精品视频| 欧美日韩视频在线观看一区二区三区| 欧美一卡二卡在线| 中文字幕免费观看一区| 亚洲国产成人高清精品| 国产一级精品在线| 日本道色综合久久| 精品国产露脸精彩对白 | 99久久久国产精品免费蜜臀| 欧美网站一区二区| 久久久久国产精品麻豆ai换脸| 亚洲人午夜精品天堂一二香蕉| 午夜精品国产更新| 福利一区二区在线观看| 欧美久久一二区| 国产精品三级久久久久三级| 亚洲成a人在线观看| 国产mv日韩mv欧美| 日韩一区二区三区在线视频| 国产精品美女久久福利网站| 五月激情综合色| 成人精品视频一区二区三区 | 久久久久久久久一| 亚洲一区二区视频| 成人av在线资源| 精品国精品国产尤物美女| 亚洲一级二级三级| 国产mv日韩mv欧美| 日韩欧美不卡在线观看视频| 夜夜精品视频一区二区| 国产一区二区三区精品视频| 欧美日韩国产一二三| 亚洲人妖av一区二区| 国产精品夜夜爽| 日韩欧美一区二区久久婷婷| 亚洲午夜久久久久久久久久久 | 日韩国产精品久久久| 色综合天天综合| 欧美高清在线精品一区| 久久精品99国产精品| 制服丝袜亚洲精品中文字幕| 一区二区三区四区不卡在线 | 欧美性欧美巨大黑白大战| 中文字幕av不卡| 精品一区二区在线观看| 91精品国产福利| 日韩电影一区二区三区四区| 欧美性受极品xxxx喷水| 亚洲精品视频一区| 91在线视频免费91| 亚洲欧美影音先锋| caoporen国产精品视频| 国产精品剧情在线亚洲| 成人av片在线观看| 国产精品不卡一区二区三区| a4yy欧美一区二区三区| 国产精品久久午夜| 99国产精品视频免费观看| 国产精品成人一区二区艾草|