System.Security.Cryptography.RC2CryptoServiceProvider.CreateDecryptor C# (CSharp) Method

CreateDecryptor() private method

private CreateDecryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte
rgbIV byte
return ICryptoTransform
        public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
        {
            return CreateTransform(rgbKey, rgbIV == null ? null : rgbIV.CloneByteArray(), encrypting: false);
        }

Usage Example

        public string mDecryptURLEncode(string EncryptedText)
        {
            string DecryptedText = "";

            System.Security.Cryptography.ICryptoTransform ssd = rc2.CreateDecryptor();

            string sEncrypt = HttpUtility.UrlDecode(EncryptedText);

            byte[] cipherBytes = Convert.FromBase64String(sEncrypt);
            byte[] initialText = null;
            using (System.IO.MemoryStream ms = new System.IO.MemoryStream(cipherBytes))
            {
                using (System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, ssd, System.Security.Cryptography.CryptoStreamMode.Read))
                {
                    int iCount = opGetArrLength(cipherBytes);
                    initialText = new Byte[cipherBytes.Length];
                    cs.Read(initialText, 0, initialText.Length);
                    cs.Close();
                    cs.Dispose();
                }
                ms.Close();
                ms.Dispose();
            }
            DecryptedText = System.Text.UTF8Encoding.UTF8.GetString(initialText);
            return(DecryptedText = DecryptedText.Replace("\0", ""));
        }
All Usage Examples Of System.Security.Cryptography.RC2CryptoServiceProvider::CreateDecryptor