Exemplo n.º 1
0
        private void VigenereDecodeButton_Click(object sender, EventArgs e)
        {
            VigenereDecodeBox.Text = vigereMethod.Decode(VigenereEncodeBox.Text, VigenereKeyBox.Text, out log);
            OutputClass.WriteToFile(VigenereDecodeBox.Text, decodePath);
            LogForm form = new LogForm(log);

            form.Show();
        }
Exemplo n.º 2
0
        private void GammaDecodeButton_Click(object sender, EventArgs e)
        {
            GammaDecodeBox.Text = gammaMethod.Decode(GammaEncodeBox.Text, GammaKeyBox.Text, out log);
            OutputClass.WriteToFile(GammaDecodeBox.Text, decodePath);
            LogForm form = new LogForm(log);

            form.Show();
        }
Exemplo n.º 3
0
        private void DecodeButton_Click(object sender, EventArgs e)
        {
            TranspositionDecodeBox.Text = transpositionMetod.Decode(TranspositionEncodeBox.Text, TranspositionKeyBox.Text, out log);
            OutputClass.WriteToFile(TranspositionDecodeBox.Text, decodePath);
            LogForm form = new LogForm(log);

            form.Show();
        }
Exemplo n.º 4
0
 private void DESEncodeDecodeButton_Click(object sender, EventArgs e)
 {
     OutputClass.WriteToFile(DESInputBox.Text, inputPath);
     byte[] buffer = desMethod.Encode(DESInputBox.Text);
     DESEncodeBox.Text = Encoding.Default.GetString(buffer);
     OutputClass.WriteToFile(DESEncodeBox.Text, decodePath);
     DESDecodeBox.Text = desMethod.Decode(buffer);
     OutputClass.WriteToFile(DESDecodeBox.Text, decodePath);
 }
Exemplo n.º 5
0
        private void RSADecodeButton_Click(object sender, EventArgs e)
        {
            int TotalSum;

            RSADecodeBox.Text = rsaMethod.Decode(RSAEncodeBox.Text, KeyBox1.Text, KeyBox2.Text, out log, out TotalSum);
            OutputClass.WriteToFile(RSADecodeBox.Text, decodePath);
            LogForm form = new LogForm(log);

            form.Show();
        }
Exemplo n.º 6
0
        private void ElGamalEncodeButton_Click(object sender, EventArgs e)
        {
            OutputClass.WriteToFile(ElGamalInputBox.Text, inputPath);

            keys = elGamalMethod.GenerateKeys();

            ElGamalEncodeBox.Text = elGamalMethod.Encode(ElGamalInputBox.Text, keys.PublicKey);
            ElGamalKey1Box.Text   = keys.PrivateKey.x.ToString();
            ElGamalKey2Box.Text   = keys.PublicKey.g.ToString() + "; " + keys.PublicKey.p.ToString() + "; " + keys.PublicKey.y.ToString();
            OutputClass.WriteToFile(ElGamalEncodeBox.Text, encodePath);
        }
Exemplo n.º 7
0
        private void RSAEncodeButton_Click(object sender, EventArgs e)
        {
            OutputClass.WriteToFile(RSAInputBox.Text, inputPath);

            string key1, key2;
            int    TotalSum;

            RSAEncodeBox.Text = rsaMethod.Encode(RSAInputBox.Text, out key1, out key2, out log, out TotalSum);
            KeyBox1.Text      = key1; KeyBox2.Text = key2;
            OutputClass.WriteToFile(RSAEncodeBox.Text, encodePath);
            LogForm form = new LogForm(log);

            form.Show();
        }
Exemplo n.º 8
0
 private void ElGamalDecodeButton_Click(object sender, EventArgs e)
 {
     ElGamalDecodeBox.Text = elGamalMethod.Decode(ElGamalEncodeBox.Text, keys);
     OutputClass.WriteToFile(ElGamalEncodeBox.Text, decodePath);
 }