示例#1
0
        public RSA()
        {
            _p = PrimeGenerator.GetPrime();
            _q = PrimeGenerator.GetPrime();

            N = _p * _q;

            long psi = (_p - 1) * (_q - 1);

            E  = PrimeGenerator.GetPrime();
            _d = MultiplicativeInverse.Calculate(E, psi);

            PublicKey   = new RSAPublicKey(N, E);
            _privateKey = new RSAPrivateKey(_p, _q);
        }
示例#2
0
 public long Verify(long signedMessage, RSAPublicKey publicKey)
 {
     return(Verify(signedMessage, publicKey.E, publicKey.N));
 }