示例#1
0
        private void Button6_Click(object sender, EventArgs e)
        {
            string pyt = UseDia.Pyt();

            if (pyt == "")
            {
                //Выходим если ничего не ввели
                goto QQ;
            }
            SIx cla = new SIx();

            cla.Proverka(pyt, textBox4);
            QQ :;
        }
示例#2
0
        public void Шифрование(string tag)
        {
            //Алгоритм шифрования 3DES
            TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider();

            XmlElement xml = UseDia.Poisk(tag);

            byte []      узел = Encoding.UTF8.GetBytes(xml.InnerText);
            MemoryStream ms   = new MemoryStream();
            //Сохраним вектор и ключ
            var          IV  = tripleDES.IV;
            var          Key = tripleDES.Key;
            CryptoStream cs  = new CryptoStream(ms, tripleDES.CreateEncryptor(Key, IV), CryptoStreamMode.Write);

            cs.Write(узел, 0, узел.Length);
            cs.Close();
        }
示例#3
0
        //Кнопка для создания ЭЦП
        private void Button5_Click(object sender, EventArgs e)
        {
            if (включитьЭЦПToolStripMenuItem.Checked != true)
            {
                throw new ArgumentException("Не нажал галочку в параметрах");
            }
            string pyt = UseDia.Pyt();

            if (pyt == "")
            {
                //Выходим если ничего не ввели
                goto QQ;
            }
            Five five = new Five();

            five.WriteDSA(pyt, textBox2, textBox3);
            QQ :;
            ////////////////ВЫход
        }