Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypt the querystring in C#.net

Tags:

c#

asp.net

string emailfield=txtEmail.Text.ToString();
string url = 
   "http://localhost:3076/user/Authenticate-Users.aspx?email="+emailfield;

I want to encrypt the querystring and then decrpyt. Is there any way to do this in C#?

Thanks

like image 716
abhijit Avatar asked Jan 21 '23 05:01

abhijit


1 Answers

You can encrypt a name/value collection to a string, and then just pass that encrypted string as a single query argument.

I demonstrate this technique in an article, Encrypting Query Arguments.

like image 153
Jonathan Wood Avatar answered Jan 22 '23 19:01

Jonathan Wood