예제 #1
0
파일: Form1.cs 프로젝트: TooSick/TI3_Sani
        private void CreateEDS_Click(object sender, EventArgs e)
        {
            RSA = new AlgorithmRSA();


            var hash      = EDS.Hash(text.Text, 2873, 2765, 345);
            var signature = BigInteger.ModPow(hash, RSA.d, RSA.r);

            edstext.Text = signature.ToString();
        }
예제 #2
0
        public static BigInteger Hash(string mes, BigInteger p, BigInteger q, BigInteger h)
        {
            var r = p * q;

            foreach (var m in mes)
            {
                h = AlgorithmRSA.Exp(h + m, 2, r);
            }

            return(h);
        }