private void button8_Click(object sender, EventArgs e)
        {
            EncryptionMode mode;

            if (rbECB_Omotnica.Checked)
            {
                mode = EncryptionMode.ECB;
            }
            else if (rbCFB_Omotnica.Checked)
            {
                mode = EncryptionMode.CFB;
            }
            else if (rbOFB_Omotnica.Checked)
            {
                mode = EncryptionMode.OFB;
            }
            else
            {
                mode = EncryptionMode.CBC;
            }

            var algorithm = rbAES_2.Checked ? SymetricAlgorithm.AES : SymetricAlgorithm.THREE_DES;

            DigitalEnvelope.OpenDigitalEnvelope(tbDigitalnaOmotnicaOtvaranje.Text, tbTajniKljucPrimatelja.Text, tbSadrzajDigitalneOmotnice.Text, mode, algorithm);
        }
Ejemplo n.º 2
0
        public static void CheckDigitalSeal(string outputFile, string RSApublicSender, string RSAprivateReciever, string envelopeFile, string signatureFile, TextBox sealCheck, EncryptionMode encryptionMode, HashingMode hashingMode, SymetricAlgorithm algorithm)
        {
            DigitalEnvelope.OpenDigitalEnvelope(envelopeFile, RSAprivateReciever, outputFile, encryptionMode, algorithm);

            var envelope = FileManager.Read_Envelope(envelopeFile);

            var hash = SHA.Hash(envelope.Data + envelope.Key, hashingMode);

            DigitalSignature.CheckDigitalSignature_FromString(hash, signatureFile, RSApublicSender, sealCheck, hashingMode);
        }