Esempio n. 1
0
        public static byte[] Decrypt(string fingerprint, byte[] cipherdata, BigInteger d, int offset, int length)
        {
            string fingerprintLower = fingerprint.ToLower();

            if (!serverKeys.ContainsKey(fingerprintLower))
            {
                return(null);
            }

            RSAServerKey key = serverKeys[fingerprintLower];

            return(key.Decrypt(cipherdata, d, offset, length));
        }
Esempio n. 2
0
        public static byte[] Encrypt(string fingerprint, byte[] data, int offset, int length)
        {
            string fingerprintLower = fingerprint.ToLower();

            if (!serverKeys.ContainsKey(fingerprintLower))
            {
                return(null);
            }

            RSAServerKey key = serverKeys[fingerprintLower];

            return(key.Encrypt(data, offset, length));
        }