-
Notifications
You must be signed in to change notification settings - Fork 0
/
Elgamal_Dekriptimi.cs
60 lines (51 loc) · 1.95 KB
/
Elgamal_Dekriptimi.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
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 CryptographyAlgorithms;
namespace ElgamalAgoritmi
{
public partial class Elgamal_Dekriptimi : Form
{
public Elgamal_Dekriptimi()
{
InitializeComponent();
}
private void ButtonDecryption_Click(object sender, EventArgs e)
{
//Hyrja
BigInteger PjesaPareTesktitEnkriptuar = BigInteger.Parse(TextBoxFirstPartOfTheCipgertext.Text);
BigInteger PjesaDyteTesktitEnkriptuar = BigInteger.Parse(TextBoxSecondPartOfTheCipgertext.Text);
Int32 QelesiSekret = Int32.Parse(TextBoxSecretKey.Text);
Int32 PjesaPareQelesitPublik = Int32.Parse(TextBoxFirstPartOfThePublicKey.Text);
//Dekriptimi
BigInteger Message = PjesaDyteTesktitEnkriptuar * BigInteger.Pow(PjesaPareTesktitEnkriptuar, PjesaPareQelesitPublik - 1 - QelesiSekret) % PjesaPareQelesitPublik;
//Dalja
LabelMessageOutput.Text = Convert.ToString(Message);
}
private void KeyGenerationToolStripMenuItem_Click(object sender, EventArgs e)
{
Elgamal_Gjenerimi_Qelesave temp = new Elgamal_Gjenerimi_Qelesave();
temp.Hide();
temp.Show();
}
private void EncryptionToolStripMenuItem_Click(object sender, EventArgs e)
{
Elgamal_Enkriptimi temp = new Elgamal_Enkriptimi();
temp.Hide();
temp.Show();
}
private void AboutCryptographyAlgorithmsToolStripMenuItem_Click(object sender, EventArgs e)
{
RrethAlgoritmitElgamal temp = new RrethAlgoritmitElgamal();
temp.Hide();
temp.Show();
}
}
}