-
Notifications
You must be signed in to change notification settings - Fork 0
/
Elgamal_Gjenerimi_Qelesave.cs
64 lines (53 loc) · 2.03 KB
/
Elgamal_Gjenerimi_Qelesave.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Numerics;
using ElgamalAgoritmi;
namespace CryptographyAlgorithms
{
public partial class Elgamal_Gjenerimi_Qelesave : Form
{
public Elgamal_Gjenerimi_Qelesave()
{
InitializeComponent();
}
private void ButtonСalculate_Click(object sender, EventArgs e)
{
//hyrja
Int32 PjesaPareQelesitPublik = Int32.Parse(txtbox_Numri_Thjeshte.Text);
Int32 PjesaDyteQelesiPublik = Int32.Parse(txtbox_Rrenja_Primitive_NumritThjesht.Text);
Int32 QelesiSekret = Int32.Parse(txtbox_NumriThjeshte_Randomt.Text);
BigInteger PjesaTreteQelesitPublik = BigInteger.Pow(PjesaDyteQelesiPublik, QelesiSekret) % PjesaPareQelesitPublik;
//dalja
LabelPublicKeyOutput.Text = Convert.ToString(PjesaPareQelesitPublik + " / " + PjesaDyteQelesiPublik + " / " + PjesaTreteQelesitPublik);
LabelSecretKeyOutput.Text = Convert.ToString(QelesiSekret);
}
private void EncryptionToolStripMenuItem_Click(object sender, EventArgs e)
{
Elgamal_Enkriptimi temp = new Elgamal_Enkriptimi();
temp.Hide();
temp.Show();
}
private void DecryptionToolStripMenuItem_Click(object sender, EventArgs e)
{
Elgamal_Dekriptimi temp = new Elgamal_Dekriptimi();
temp.Hide();
temp.Show();
}
private void AboutCryptographyAlgorithmsToolStripMenuItem_Click(object sender, EventArgs e)
{
RrethAlgoritmitElgamal temp = new RrethAlgoritmitElgamal();
temp.Hide();
temp.Show();
}
private void Elgamal_Gjenerimi_Qelesave_Load(object sender, EventArgs e)
{
}
}
}