-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeyGenFrm.cs
137 lines (99 loc) · 3.25 KB
/
KeyGenFrm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace seaBass
{
public partial class KeyGenFrm : Form
{
public KeyGenFrm()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void btnProcess_Click(object sender, EventArgs e)
{
//in an'
// if(!(txtinputlength.Text == "" || txtStringIn.Text == "" || txtRatioIN.Text == ""))
{
string passPhrase = lblStringIn.Text;
Int32 length;
bool parse;
string lengthString = txtinputlength.Text;
parse = Int32.TryParse(lengthString, out length);
bool parse2;
int ratio;
string ratioString = txtRatioIN.Text;
parse2 = int.TryParse(ratioString, out ratio);
//if (length <= 100000)
//{
// genKey(length, ratio);
//}
//if (length > 100000)
//{
// txtinputlength.Text = "For preformance reasons must be less than 100,000";
//}
genKey(length, ratio);
}
}
private void genKey(int length, int ratio)
{
string key = "";
Concealer keyGen = new Concealer();
String input = txtStringIn.Text;
string test = "length: " + length + " ratio " + ratio + " input " + input;
key = keyGen.keyGen(length,input,ratio);
//txtKeyOutput.Text = "hello world "+key.Count()+"!";
txtKeyOutput.Text = key;
// txtKeyOutput.Text = test;
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void rdbtnString_CheckedChanged(object sender, EventArgs e)
{
}
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void rdbtnNoString_CheckedChanged(object sender, EventArgs e)
{
}
private void gbSringRadio_Enter(object sender, EventArgs e)
{
}
private void KeyGenFrm_Load(object sender, EventArgs e)
{
}
private void btnSelectNCopy_Click(object sender, EventArgs e)
{
txtKeyOutput.SelectAll();
txtKeyOutput.Copy();
Process.Start("notepad.exe", "key.txt");
System.IO.File.WriteAllText("key.txt", txtKeyOutput.Text);
}
private void btnMenu_Click(object sender, EventArgs e)
{
Operator operations = new Operator();
this.Hide();
operations.loop();
}
private void txtRatioIN_TextChanged(object sender, EventArgs e)
{
}
private void lblKeyLengthInput_Click(object sender, EventArgs e)
{
}
}
}