Beispiel #1
0
        internal byte[] private_decrypt(byte[] input, bool do_final)
        {
            byte[] output = new byte[_key_size];
            Buffer.BlockCopy(input, 0, output, 0, input.Length);
            for (int i = 0; i < (_key_size / 2); i++)
            {
                byte c = output[i];
                output[i] = output[_key_size - 1 - i];
                output[_key_size - 1 - i] = c;
            }
            int  dword_input_size = input.Length;
            bool result           = Crypt32.CryptDecrypt(_key, IntPtr.Zero, do_final, Crypt32.CRYPT_OAEP,
                                                         ref output, ref dword_input_size);

            Helpers.Resize(ref output, dword_input_size); // is this necessary?
            return(output);
        }