How can I encrypt a querystring in asp.net?

前端 未结 6 1187
星月不相逢
星月不相逢 2020-12-02 19:37

I need to encrypt and decrypt a querystring in ASP.NET.

The querystring might look something like this:

http://www.mysite.com/report.aspx?id=

6条回答
  •  一生所求
    2020-12-02 20:14

    I can't give you a turn key solution off the top of my head, but you should avoid TripleDES since it is not as secure as other encryption methods.

    If I were doing it, I'd just take the entire URL (domain and querystring) as a URI object, encrypt it with one of the built-in .NET libraries and supply it as the crypt object. When I need to decrypt it, do so, then create a new URI object, which will let you get everything back out of the original querystring.

提交回复
热议问题