Compare commits

...

3 Commits
0.1 ... master

4 changed files with 42 additions and 4 deletions

View File

@ -33,6 +33,12 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MMLib.Core, Version=1.0.5305.36249, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MMLib.Extensions.1.0.10.13\lib\MMLib.Core.dll</HintPath>
</Reference>
<Reference Include="MMLib.Extensions, Version=1.0.2.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MMLib.Extensions.1.0.10.13\lib\MMLib.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -66,6 +72,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

13
main_form.Designer.cs generated
View File

@ -62,6 +62,7 @@
this.textBox12 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.textBox13 = new System.Windows.Forms.TextBox();
this.button5 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
@ -370,12 +371,23 @@
this.textBox13.Size = new System.Drawing.Size(313, 20);
this.textBox13.TabIndex = 513;
//
// button5
//
this.button5.Location = new System.Drawing.Point(230, 461);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(95, 23);
this.button5.TabIndex = 517;
this.button5.Text = "cp for decryption";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// main_form
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(1140, 491);
this.Controls.Add(this.button5);
this.Controls.Add(this.label13);
this.Controls.Add(this.textBox12);
this.Controls.Add(this.label14);
@ -457,6 +469,7 @@
private System.Windows.Forms.TextBox textBox12;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.TextBox textBox13;
private System.Windows.Forms.Button button5;
}
}

View File

@ -36,6 +36,7 @@ namespace KRY_0x01_ng
string introduce_chaos(string str)
{
string nustr = Regex.Replace(str, " ", "SPACEBRO");
nustr = MMLib.Extensions.StringExtensions.RemoveDiacritics(nustr);
nustr = Regex.Replace(nustr, "W", "V");
nustr = Regex.Replace(nustr, ",", "COMMABRO");
return nustr.Replace(".", "DOTBRO");
@ -88,8 +89,9 @@ namespace KRY_0x01_ng
MessageBox.Show("Empty key.", "Warning");
return false;
}
string str_to_check = String.Join("", tb_k.Text.ToUpper().Distinct());
string str_to_check = MMLib.Extensions.StringExtensions.RemoveDiacritics(tb_k.Text.ToUpper());
str_to_check = String.Join("", str_to_check.Distinct());
if (str_to_check.Length < 9)
{
/* because why not, 8 is still lame */
@ -102,10 +104,10 @@ namespace KRY_0x01_ng
return false;
}
Match match = Regex.Match(str_to_check, @"\d|\s+");
Match match = Regex.Match(str_to_check, @"\d|\s+|W");
if (match.Success)
{
MessageBox.Show("Only alphabetic characters are allowed.\nCheck the key for numbers, symbols or tab whitespace and remove them before continuing.", "Error: invalid chars in key");
MessageBox.Show("Only alphabetic characters (with the exception of 'W') are allowed.\nCheck the key for numbers, symbols or tab whitespace and remove them before continuing.", "Error: invalid chars in key");
return false;
}
@ -165,6 +167,7 @@ namespace KRY_0x01_ng
return;
}
string msg = introduce_chaos(tb_m.Text.ToUpper());
msg = MMLib.Extensions.StringExtensions.RemoveDiacritics(msg);
Match match = Regex.Match(msg, @"\d|\s+");
if (match.Success)
{
@ -183,6 +186,7 @@ namespace KRY_0x01_ng
return false;
}
string msg = tb_m.Text.ToUpper();
msg = MMLib.Extensions.StringExtensions.RemoveDiacritics(msg);
Match match = Regex.Match(msg, @"\d|\s+|W");
if (match.Success)
{
@ -381,5 +385,15 @@ namespace KRY_0x01_ng
/* decrypt */
decrypt();
}
private void button5_Click(object sender, EventArgs e)
{
/* copy for decryption (tb7 --> tb9) */
string cryptmsg = textBox7.Text.Trim();
cryptmsg = String.Join("", cryptmsg);
cryptmsg = Regex.Replace(cryptmsg, @"\s+|", "");
textBox9.Text = cryptmsg;
MessageBox.Show("great success","cryptmsg has been copied");
}
}
}

4
packages.config Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MMLib.Extensions" version="1.0.10.13" targetFramework="net48" />
</packages>