예제 #1
0
 public Abonent(int bitLengthPQ)
 {
     GeneratePrimeNumbers(bitLengthPQ);
     N = BigInteger.Multiply(P, Q);
     EulerFunctionResult = BigInteger.Multiply(P - 1, Q - 1);
     Exponent            = (int)Math.Pow(2, 16) + 1;
     D = BigIntegerExtensions.ModInverse(Exponent, EulerFunctionResult);
     ReceivedKeyToVerify = null;
 }
예제 #2
0
        private void GeneratePrimeNumbers(int bitLength)
        {
            do
            {
                P = BigIntegerExtensions.NextBigInteger(bitLength);
            }while (!P.MillerRabinTest(1250));

            System.Threading.Thread.Sleep(1000);

            do
            {
                Q = BigIntegerExtensions.NextBigInteger(bitLength);
            }while (!Q.MillerRabinTest(1250));
        }