Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.label10.Visible  = true;
            this.textBox8.Visible = true;
            ulong secretkey = Convert.ToUInt64(this.textBox4.Text);
            ulong module    = Convert.ToUInt64(this.textBox6.Text);
            RSA   rsa       = new RSA(secretkey, "Закрытый");

            ulong[] decypher = rsa.Decription(this.Cypher, module);
            this.textBox8.Text = Coding.Decoding(decypher);
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ulong   P   = Convert.ToUInt64(this.textBox1.Text);
            ulong   G   = Convert.ToUInt64(this.textBox2.Text);
            ulong   X   = Convert.ToUInt64(this.textBox3.Text);
            ElGamal ElG = new ElGamal(P, G, X);

            ElG.a = Cypher[0];
            int CypherLength = Cypher.Length - 1;

            ulong[] cypher = new ulong[CypherLength];
            for (int i = 0; i < CypherLength; ++i)
            {
                cypher[i] = Cypher[i + 1];
            }
            ulong[] decypher = ElG.Decryption(cypher);
            this.textBox8.Text = Coding.Decoding(decypher);
        }