From a4fe931601156d30558e5a665f7e14c95804bfce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=82=85Fox?= Date: Sun, 14 Jun 2015 13:42:31 +0800 Subject: [PATCH] CryptionDebugger rolling key view CryptionDebugger rolling key view Fix decryption bug in CryptionDebugger --- Auth/Properties/AssemblyInfo.cs | 4 +-- CryptionDebugger/Main.cs | 2 +- CryptionDebugger/Properties/AssemblyInfo.cs | 4 +-- CryptionDebugger/RollingKey.Designer.cs | 29 +++++++++++++++++---- CryptionDebugger/RollingKey.cs | 7 ++++- CryptionDebugger/RollingKey.resx | 3 +++ URLSchemeHandler/Properties/AssemblyInfo.cs | 4 +-- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Auth/Properties/AssemblyInfo.cs b/Auth/Properties/AssemblyInfo.cs index c098e54..5414edc 100644 --- a/Auth/Properties/AssemblyInfo.cs +++ b/Auth/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.4")] -[assembly: AssemblyFileVersion("1.2.0.4")] +[assembly: AssemblyVersion("1.2.0.5")] +[assembly: AssemblyFileVersion("1.2.0.5")] diff --git a/CryptionDebugger/Main.cs b/CryptionDebugger/Main.cs index 3ac4cba..d2f93d3 100644 --- a/CryptionDebugger/Main.cs +++ b/CryptionDebugger/Main.cs @@ -31,7 +31,7 @@ private void decryptButton_Click(object sender, EventArgs e) private void showRollingKeyFormButton_Click(object sender, EventArgs e) { var frm = new RollingKey(); - frm.ShowDialog(); + frm.Show(); } } } diff --git a/CryptionDebugger/Properties/AssemblyInfo.cs b/CryptionDebugger/Properties/AssemblyInfo.cs index f1506f5..7f8ddcc 100644 --- a/CryptionDebugger/Properties/AssemblyInfo.cs +++ b/CryptionDebugger/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.1.1")] -[assembly: AssemblyFileVersion("1.1.1.1")] +[assembly: AssemblyVersion("1.1.1.3")] +[assembly: AssemblyFileVersion("1.1.1.3")] diff --git a/CryptionDebugger/RollingKey.Designer.cs b/CryptionDebugger/RollingKey.Designer.cs index 498b328..1622f96 100644 --- a/CryptionDebugger/RollingKey.Designer.cs +++ b/CryptionDebugger/RollingKey.Designer.cs @@ -28,30 +28,33 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.cipherTextBox = new System.Windows.Forms.TextBox(); this.sourceTextBox = new System.Windows.Forms.TextBox(); this.decryptButton = new System.Windows.Forms.Button(); this.encryptButton = new System.Windows.Forms.Button(); this.originalKeyBox = new System.Windows.Forms.TextBox(); + this.keyBox = new System.Windows.Forms.TextBox(); + this.timer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // cipherTextBox // - this.cipherTextBox.Location = new System.Drawing.Point(12, 110); + this.cipherTextBox.Location = new System.Drawing.Point(12, 123); this.cipherTextBox.Name = "cipherTextBox"; this.cipherTextBox.Size = new System.Drawing.Size(179, 21); this.cipherTextBox.TabIndex = 7; // // sourceTextBox // - this.sourceTextBox.Location = new System.Drawing.Point(12, 64); + this.sourceTextBox.Location = new System.Drawing.Point(12, 77); this.sourceTextBox.Name = "sourceTextBox"; this.sourceTextBox.Size = new System.Drawing.Size(179, 21); this.sourceTextBox.TabIndex = 6; // // decryptButton // - this.decryptButton.Location = new System.Drawing.Point(197, 99); + this.decryptButton.Location = new System.Drawing.Point(197, 112); this.decryptButton.Name = "decryptButton"; this.decryptButton.Size = new System.Drawing.Size(75, 40); this.decryptButton.TabIndex = 5; @@ -61,7 +64,7 @@ private void InitializeComponent() // // encryptButton // - this.encryptButton.Location = new System.Drawing.Point(197, 53); + this.encryptButton.Location = new System.Drawing.Point(197, 66); this.encryptButton.Name = "encryptButton"; this.encryptButton.Size = new System.Drawing.Size(75, 40); this.encryptButton.TabIndex = 4; @@ -77,11 +80,25 @@ private void InitializeComponent() this.originalKeyBox.TabIndex = 8; this.originalKeyBox.Text = "CF166A138A5B6AD5"; // + // keyBox + // + this.keyBox.Location = new System.Drawing.Point(12, 39); + this.keyBox.Name = "keyBox"; + this.keyBox.Size = new System.Drawing.Size(260, 21); + this.keyBox.TabIndex = 9; + // + // timer + // + this.timer.Enabled = true; + this.timer.Interval = 5000; + this.timer.Tick += new System.EventHandler(this.timer_Tick); + // // RollingKey // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 151); + this.ClientSize = new System.Drawing.Size(284, 167); + this.Controls.Add(this.keyBox); this.Controls.Add(this.originalKeyBox); this.Controls.Add(this.cipherTextBox); this.Controls.Add(this.sourceTextBox); @@ -101,5 +118,7 @@ private void InitializeComponent() private System.Windows.Forms.Button decryptButton; private System.Windows.Forms.Button encryptButton; private System.Windows.Forms.TextBox originalKeyBox; + private System.Windows.Forms.TextBox keyBox; + private System.Windows.Forms.Timer timer; } } \ No newline at end of file diff --git a/CryptionDebugger/RollingKey.cs b/CryptionDebugger/RollingKey.cs index 372a6d7..41ecdc5 100644 --- a/CryptionDebugger/RollingKey.cs +++ b/CryptionDebugger/RollingKey.cs @@ -25,7 +25,12 @@ private void encryptButton_Click(object sender, EventArgs e) private void decryptButton_Click(object sender, EventArgs e) { - this.sourceTextBox.Text = Crypt.Encrypt(this.cipherTextBox.Text, Crypt.GenerateKey(this.originalKeyBox.Text)); + this.sourceTextBox.Text = Crypt.Decrypt(this.cipherTextBox.Text, Crypt.GenerateKey(this.originalKeyBox.Text)); + } + + private void timer_Tick(object sender, EventArgs e) + { + this.keyBox.Text = Crypt.GenerateKey(this.originalKeyBox.Text); } } } diff --git a/CryptionDebugger/RollingKey.resx b/CryptionDebugger/RollingKey.resx index 29dcb1b..b351ef9 100644 --- a/CryptionDebugger/RollingKey.resx +++ b/CryptionDebugger/RollingKey.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/URLSchemeHandler/Properties/AssemblyInfo.cs b/URLSchemeHandler/Properties/AssemblyInfo.cs index f9f85fc..65eefd4 100644 --- a/URLSchemeHandler/Properties/AssemblyInfo.cs +++ b/URLSchemeHandler/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.13")] -[assembly: AssemblyFileVersion("1.1.0.13")] +[assembly: AssemblyVersion("1.1.0.14")] +[assembly: AssemblyFileVersion("1.1.0.14")]