LISTING PROGRAM
1. MainForm.cs
using System;
using System.Collections.Generic; using System.Drawing;
using System.Windows.Forms;
namespace generate_password {
/// <summary>
/// Description of MainForm. /// </summary>
public partial class MainForm : Form {
public MainForm() {
//
// The InitializeComponent() call is required for Windows Forms designer support. //
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call. //
}
void BBSToolStripMenuItemClick(object sender, EventArgs e) {
bbs f = new bbs(); this.Hide(); f.Show(); }
void QLGCToolStripMenuItemClick(object sender, EventArgs e) {
qlcg f = new qlcg(); this.Hide();
f.Show(); }
void AboutToolStripMenuItemClick(object sender, EventArgs e) {
about f = new about(); this.Hide();
f.Show(); }
help f = new help(); this.Hide();
f.Show(); }
} }
2. BBS.cs usingSystem;
usingSystem.Drawing;
usingSystem.Windows.Forms;
usingSystem.Diagnostics;
namespacegenerate_password
{
///<summary>
///Description of bbs. ///</summary>
publicpartialclassbbs : Form {
Stopwatch watch =newStopwatch(); intp,q,n,s;
Random r =newRandom(); publicbbs()
{ //
// The InitializeComponent() call is required for Windows Forms designer support. //
InitializeComponent();
//
//TODO: Add constructor code after the InitializeComponent() call. //
}
publicboolIsPrime(intnum) {
bool_isPrime =true;
if(num%2==0)returnfalse; if(num%4!=3)returnfalse;
for(inti =3;i<= Math.Sqrt(num);i = i+2) {
if(num%i ==0) {
_isPrime =false; break;
} }
}
publicintGCD(inta,intb) {
intRemainder; while(b!=0) {
Remainder = a%b; a = b;
b = Remainder; }
returna; }
voidButton4Click(objectsender,EventArgs e) {
p = r.Next(3,10000);
while(IsPrime(p)==false) {
p = r.Next(3,10000); }
q = r.Next(3,10000);
while(IsPrime(q)==false) {
q = r.Next(3,10000); }
n = p*q;
textBox1.Text = p.ToString(); textBox2.Text = q.ToString(); textBox3.Text = n.ToString(); }
voidButton3Click(objectsender,EventArgs e) {
s = r.Next(2,n-1); while(GCD(n,s)!=1) {
s = r.Next(2,n-1); }
textBox4.Text = s.ToString(); }
voidBbsLoad(objectsender,EventArgs e) {
label5.Visible =false; label5.Text =null; }
MainForm f =newMainForm(); this.Hide();
f.Show(); }
voidButton2Click(objectsender,EventArgs e) {
p =0; q =0; n =0; s =0;
textBox1.Text =null; textBox2.Text =null; textBox3.Text =null; textBox4.Text =null; label5.Text =null; textBox6.Text =null; label5.Visible =false; }
voidButton1Click(objectsender,EventArgs e) {
label5.Text =null; watch.Restart(); doublex = s;
x =(Math.Pow(x,2))%n; inthasil;
int[]lastbin =newint[4]; while(label5.Text.Length <11) {
for(inti =0;i<4;i++) {
x =(Math.Pow(x,2))%n; if(x%2==0)
lastbin[i]=0; else
lastbin[i]=1; }
hasil =8*lastbin[0]+4*lastbin[1]+2*lastbin[2]+1*lastbin[3]; label5.Text+= hasil.ToString();
}
if(label5.Text.Length>10)
label5.Text = label5.Text.Substring(0,10); label5.Visible =true;
watch.Stop(); textBox6.Text =
Math.Round(Convert.ToDecimal(watch.Elapsed.TotalMilliseconds),4).ToString(); }
3. QLCG.cs
usingSystem;
usingSystem.Drawing;
usingSystem.Windows.Forms;
usingSystem.Diagnostics;
namespacegenerate_password
{
///<summary>
///Description of qlcg. ///</summary>
publicpartialclassqlcg : Form {
Stopwatch watch =newStopwatch(); inta,b,c,m,x0;
publicqlcg() {
//
// The InitializeComponent() call is required for Windows Forms designer support. //
InitializeComponent();
//
//TODO: Add constructor code after the InitializeComponent() call. //
}
voidButton2Click(objectsender,EventArgs e) {
a =0; b =0; c =0; m =0; x0 =0;
textBox1.Text =null; textBox2.Text =null; textBox3.Text =null; textBox4.Text =null; textBox5.Text =null; label5.Text =null; textBox6.Text =null; label5.Visible =false; }
voidButton5Click(objectsender,EventArgs e) {
MainForm f =newMainForm(); this.Hide();
}
voidQlcgLoad(objectsender,EventArgs e) {
label5.Visible =false; label5.Text =null; }
voidButton1Click(objectsender,EventArgs e) {
label5.Text =null; watch.Restart();
a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); c = Convert.ToInt32(textBox3.Text); m = Convert.ToInt32(textBox4.Text); x0 = Convert.ToInt32(textBox5.Text); if(a>= m||b>= m||c>= m||x0>= m) {
MessageBox.Show("generate ulang !!!"); }
else {
doublex = x0; inthasil;
int[]lastbin =newint[4]; while(label5.Text.Length <11) {
for(inti =0;i<4;i++) {
x =((a*x*x)+(b*x)+c)%m; if(x%2==0)
lastbin[i]=0; else
lastbin[i]=1; }
hasil =8*lastbin[0]+4*lastbin[1]+2*lastbin[2]+1*lastbin[3]; label5.Text+= hasil.ToString();
}
if(label5.Text.Length>10)
label5.Text = label5.Text.Substring(0,10); label5.Visible =true;
}
watch.Stop(); textBox6.Text =
Math.Round(Convert.ToDecimal(watch.Elapsed.TotalMilliseconds),4).ToString();
4. About.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password {
/// <summary>
/// Description of about. /// </summary>
public partial class about : Form {
public about() {
//
// The InitializeComponent() call is required for Windows Forms designer support. //
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call. //
}
void HomeToolStripMenuItemClick(object sender, EventArgs e) {
MainForm f = new MainForm(); this.Hide();
f.Show(); }
void QLCGToolStripMenuItemClick(object sender, EventArgs e) {
qlcg f = new qlcg(); this.Hide();
f.Show(); }
void BBSToolStripMenuItemClick(object sender, EventArgs e) {
bbs f = new bbs(); this.Hide(); f.Show(); }
void HelpToolStripMenuItemClick(object sender, EventArgs e) {
f.Show(); }
} }
5. Help.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password {
/// <summary>
/// Description of help. /// </summary>
public partial class help : Form {
public help() {
//
// The InitializeComponent() call is required for Windows Forms designer support. //
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call. //
}
void HelpToolStripMenuItemClick(object sender, EventArgs e) {
about f = new about(); this.Hide();
f.Show(); }
void HomeToolStripMenuItemClick(object sender, EventArgs e) {
MainForm f = new MainForm(); this.Hide();
f.Show(); }
void BBSToolStripMenuItemClick(object sender, EventArgs e) {
void QLCGToolStripMenuItemClick(object sender, EventArgs e) {
qlcg f = new qlcg(); this.Hide();
f.Show(); }
void Label2Click(object sender, EventArgs e) {
}
void Label11Click(object sender, EventArgs e) {
}
void Label7Click(object sender, EventArgs e) {
}
void Label8Click(object sender, EventArgs e) {
}
void Label13Click(object sender, EventArgs e) {
} } }
6. Program.cs
using System;
using System.Windows.Forms;
namespace generate_password {
/// <summary>
/// Class with program entry point. /// </summary>
internal sealed class Program {
/// <summary>
[STAThread]
private static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm());
B-1
PERSONAL DATA
Full Name Denny Dwi Daviki Lubis
Nick Name Denny
Place / Date of
Birth
Binjai/30 Juli 1992
Sex Male
Religion Islam
Address Jl. Anggrek No.35a
Kec. Binjai Utara
Kota Binjai
Prov. Sumatera Utrara
Mobile Phone 0831 9932 8905
E-mail nobodyx92@gmail.com
EDUCATION
Barchelor
Computer Science
Universitas Sumatera Utara
2014-2017
Diploma 3
Computer Engineering
Politeknik Negeri Medan
2010-2013
Higher Secondary Education SMA N 2 Binjai
2007-2010
Secondary Education SMP N 3 Binjai
2004-2007
Primary Education SD N 023903 Binjai
1997-2004
COMPUTER SKILL
Programming Java, C#