Example #1
0
        private void Deserialize(string encryptedString)
        {
            HttpServerUtility server = HttpContext.Current.Server;

            // Decode the string back into a byte array.
            byte[] encryptedData = HexEncoding.GetBytes(encryptedString);

            // Decrypt the string.
            string decryptedString = EncryptionUtil.DecryptToString(encryptedData, crypt);

            // Split the string into values.
            string[] values = decryptedString.Split('&');
            foreach (string val in values)
            {
                string[] nameValuePair = val.Split('=');
                base.Add(server.UrlDecode(nameValuePair[0]), server.UrlDecode(nameValuePair[1]));
            }
        }