Exemple #1
0
        public static byte[] Encrypt(byte[] plain, RSAPublic pub)
        {
            BigInteger plainInt  = new BigInteger(plain);
            BigInteger cipherInt = BigInteger.ModPow(plainInt, pub.E, pub.N);

            return(cipherInt.ToByteArray());
        }
Exemple #2
0
 public RSAKeyPair(RSAPublic pub, RSAPrivate pri)
 {
     Public  = pub;
     Private = pri;
 }