Implementasi Perbedaan Algoritma Blim-Blum-Shub Dengan Algoritma Quadratic Linear Congruential Generator Pada Aplikasi Password Generator
LISTING PROGRAM
1. MainForm.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of MainForm.
///
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();
}
void HelpToolStripMenuItemClick(object sender, EventArgs e)
{
Universitas Sumatera Utara
help f = new help();
this.Hide();
f.Show();
}
}
}
2. BBS.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
namespace generate_password
{
///
/// Description of bbs.
///
public partial class bbs : Form
{
Stopwatch watch = new Stopwatch();
int p,q,n,s;
Random r = new Random();
public bbs()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
}
//
// TODO: Add constructor code after the InitializeComponent() call.
//
public bool IsPrime(int num)
{
bool _isPrime = true;
if (num % 2 == 0) return false;
if (num % 4 != 3) return false;
for (int i = 3; i 10)
label5.Text = label5.Text.Substring(0,10);
label5.Visible = true;
watch.Stop();
textBox6.Text =
Math.Round(Convert.ToDecimal(watch.Elapsed.TotalMilliseconds),4).ToString();
}
}
}
Universitas Sumatera Utara
3. QLCG.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
namespace generate_password
{
///
/// Description of qlcg.
///
public partial class qlcg : Form
{
Stopwatch watch = new Stopwatch();
int a,b,c,m,x0;
public qlcg()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
}
//
// TODO: Add constructor code after the InitializeComponent() call.
//
void Button2Click(object sender, 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;
}
void Button5Click(object sender, EventArgs e)
{
MainForm f = new MainForm();
this.Hide();
f.Show();
Universitas Sumatera Utara
}
void QlcgLoad(object sender, EventArgs e)
{
label5.Visible = false;
label5.Text = null;
}
void Button1Click(object sender, 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
{
double x = x0;
int hasil;
int[] lastbin = new int[4];
while (label5.Text.Length < 11)
{
for (int i = 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();
}
}
}
Universitas Sumatera Utara
4. About.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of about.
///
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)
{
help f = new help();
this.Hide();
Universitas Sumatera Utara
f.Show();
}
}
}
5. Help.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of help.
///
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)
{
bbs f = new bbs();
this.Hide();
f.Show();
}
Universitas Sumatera Utara
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
{
///
/// Class with program entry point.
///
internal sealed class Program
{
///
/// Program entry point.
///
Universitas Sumatera Utara
[STAThread]
private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
Universitas Sumatera Utara
B-1
PERSONAL DATA
Full Name
Denny Dwi Daviki Lubis
Nick Name
Denny
Place / Date of Binjai/30 Juli 1992
Birth
Sex
Male
Religion
Islam
Address
Jl. Anggrek No.35a
Kec. Binjai Utara
Kota Binjai
Prov. Sumatera Utrara
Mobile Phone
0831 9932 8905
E-mail
[email protected]
EDUCATION
Barchelor
Universitas Sumatera Utara
Computer Science
2014-2017
Diploma 3
Politeknik Negeri Medan
Computer Engineering
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#
Design
Photoshop, Illustrator, Corel Draw
Universitas Sumatera Utara
1. MainForm.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of MainForm.
///
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();
}
void HelpToolStripMenuItemClick(object sender, EventArgs e)
{
Universitas Sumatera Utara
help f = new help();
this.Hide();
f.Show();
}
}
}
2. BBS.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
namespace generate_password
{
///
/// Description of bbs.
///
public partial class bbs : Form
{
Stopwatch watch = new Stopwatch();
int p,q,n,s;
Random r = new Random();
public bbs()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
}
//
// TODO: Add constructor code after the InitializeComponent() call.
//
public bool IsPrime(int num)
{
bool _isPrime = true;
if (num % 2 == 0) return false;
if (num % 4 != 3) return false;
for (int i = 3; i 10)
label5.Text = label5.Text.Substring(0,10);
label5.Visible = true;
watch.Stop();
textBox6.Text =
Math.Round(Convert.ToDecimal(watch.Elapsed.TotalMilliseconds),4).ToString();
}
}
}
Universitas Sumatera Utara
3. QLCG.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
namespace generate_password
{
///
/// Description of qlcg.
///
public partial class qlcg : Form
{
Stopwatch watch = new Stopwatch();
int a,b,c,m,x0;
public qlcg()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
}
//
// TODO: Add constructor code after the InitializeComponent() call.
//
void Button2Click(object sender, 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;
}
void Button5Click(object sender, EventArgs e)
{
MainForm f = new MainForm();
this.Hide();
f.Show();
Universitas Sumatera Utara
}
void QlcgLoad(object sender, EventArgs e)
{
label5.Visible = false;
label5.Text = null;
}
void Button1Click(object sender, 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
{
double x = x0;
int hasil;
int[] lastbin = new int[4];
while (label5.Text.Length < 11)
{
for (int i = 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();
}
}
}
Universitas Sumatera Utara
4. About.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of about.
///
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)
{
help f = new help();
this.Hide();
Universitas Sumatera Utara
f.Show();
}
}
}
5. Help.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace generate_password
{
///
/// Description of help.
///
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)
{
bbs f = new bbs();
this.Hide();
f.Show();
}
Universitas Sumatera Utara
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
{
///
/// Class with program entry point.
///
internal sealed class Program
{
///
/// Program entry point.
///
Universitas Sumatera Utara
[STAThread]
private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
Universitas Sumatera Utara
B-1
PERSONAL DATA
Full Name
Denny Dwi Daviki Lubis
Nick Name
Denny
Place / Date of Binjai/30 Juli 1992
Birth
Sex
Male
Religion
Islam
Address
Jl. Anggrek No.35a
Kec. Binjai Utara
Kota Binjai
Prov. Sumatera Utrara
Mobile Phone
0831 9932 8905
[email protected]
EDUCATION
Barchelor
Universitas Sumatera Utara
Computer Science
2014-2017
Diploma 3
Politeknik Negeri Medan
Computer Engineering
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#
Design
Photoshop, Illustrator, Corel Draw
Universitas Sumatera Utara