Exemple #1
0
        public static byte[] smethod_1(this RSACryptoServiceProvider rsacryptoServiceProvider_0, byte[] byte_0)
        {
            if (byte_0 == null)
            {
                throw new ArgumentNullException("cipherData");
            }
            BigInteger    value         = new BigInteger(byte_0);
            RSAParameters rsaparameters = rsacryptoServiceProvider_0.ExportParameters(false);
            BigInteger    exponent      = GClass881.smethod_2(rsaparameters.Exponent);
            BigInteger    modulus       = GClass881.smethod_2(rsaparameters.Modulus);

            byte[] array  = BigInteger.ModPow(value, exponent, modulus).ToByteArray();
            byte[] array2 = new byte[array.Length - 1];
            Array.Copy(array, array2, array2.Length);
            array2 = GClass881.smethod_4(array2);
            Array.Reverse(array2);
            return(array2);
        }
Exemple #2
0
        public static byte[] smethod_0(this RSACryptoServiceProvider rsacryptoServiceProvider_0, byte[] byte_0)
        {
            if (byte_0 == null)
            {
                throw new ArgumentNullException("data");
            }
            if (rsacryptoServiceProvider_0.PublicOnly)
            {
                throw new InvalidOperationException("Private key is not loaded");
            }
            int num = rsacryptoServiceProvider_0.KeySize / 8 - 6;

            if (byte_0.Length > num)
            {
                throw new ArgumentOutOfRangeException("data", string.Format("Maximum data length for the current key size ({0} bits) is {1} bytes (current length: {2} bytes)", rsacryptoServiceProvider_0.KeySize, num, byte_0.Length));
            }
            BigInteger    value         = GClass881.smethod_2(GClass881.smethod_3(byte_0));
            RSAParameters rsaparameters = rsacryptoServiceProvider_0.ExportParameters(true);
            BigInteger    exponent      = GClass881.smethod_2(rsaparameters.D);
            BigInteger    modulus       = GClass881.smethod_2(rsaparameters.Modulus);

            return(BigInteger.ModPow(value, exponent, modulus).ToByteArray());
        }