Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Below is my query string code:
Response.Redirect("Default.aspx?name=" + txtname.Text + "&add=" + txtaddress.Text + "&email=" + txtemail.Text + "&city=" + txtcity.Text + "&state=" + txtstate.Text + "&zip=" +txtcountry.Text + "&country=" +txtcountry.Text+ "&payment="+txtamount.Text +"&specialcondition="+txtspeclcondition.Text);
Posted

Why passing these values via query? Put them in a session variable and check in Default.aspx if this one is set or not. If set, handle it and delete from the session. If not, behave normally.

But if you stick to crypto, check out this short tutorial: http://www.dijksterhuis.org/encrypting-decrypting-string/[^]. I would not encrypt every field value separately, I would serialize the dictionary (to json string for example), encrypt, encode to base64 (see the tutorial) - and at the other end the reverse process.
 
Share this answer
 
v2
Comments
Mas11 16-Oct-12 4:28am    
Very nice!!, thanks bro for your logic.
Zoltán Zörgő 16-Oct-12 4:31am    
See update too
C#
Hey Guys I have solved this. Just enjoying by my Code !

//-------- Code For Encrypt----------------------------------

 public string EncryptString(string ClearText)
    {

        byte[] clearTextBytes = Encoding.UTF8.GetBytes(ClearText);

        System.Security.Cryptography.SymmetricAlgorithm rijn = SymmetricAlgorithm.Create();

        MemoryStream ms = new MemoryStream();
        byte[] rgbIV = Encoding.ASCII.GetBytes("ryojvlzmdalyglrj");
        byte[] key = Encoding.ASCII.GetBytes("hcxilkqbbhczfeultgbskdmaunivmfuo");
        CryptoStream cs = new CryptoStream(ms, rijn.CreateEncryptor(key, rgbIV),
   CryptoStreamMode.Write);

        cs.Write(clearTextBytes, 0, clearTextBytes.Length);

        cs.Close();

        return Convert.ToBase64String(ms.ToArray());
    }


//-------- Code For Decrypt----------------------------------



public string DecryptString(string query)
    {
        string result = "";

        try
        {
            MemoryStream ms = null;
            if (query != "")
            {
                string EncryptedText = query;
                EncryptedText = EncryptedText.Replace(' ', '+');

                byte[] encryptedTextBytes = Convert.FromBase64String(EncryptedText);
                ms = new MemoryStream();
                System.Security.Cryptography.SymmetricAlgorithm rijn = SymmetricAlgorithm.Create();

                byte[] rgbIV = Encoding.ASCII.GetBytes("ryojvlzmdalyglrj");
                byte[] key = Encoding.ASCII.GetBytes("hcxilkqbbhczfeultgbskdmaunivmfuo");

                CryptoStream cs = new CryptoStream(ms, rijn.CreateDecryptor(key, rgbIV),
                CryptoStreamMode.Write);

                cs.Write(encryptedTextBytes, 0, encryptedTextBytes.Length);

                cs.Close();
                result = Encoding.UTF8.GetString(ms.ToArray());
            }
        }
        catch (Exception ex)
        {
            RecordExceptions(ex);
        }
        return result;
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900