Encryption for QueryString

R

Raheel Hussain

hi guyz.

I want to put encryption for every querystring for my web application.

for that right now i m using a custom function.

can any body tell me if there is some builtin function available in .net
which i can implement.

wht i want is that the query string value should be sent in decrypted
format and on the second page i catch this value and decrypt it and then
use it appropriately.

another problem i m having is that i cant apply encryption function on
the "hyperlink" column of datagrid.


normally in code

'sending
response.redirect "somepage.aspx?id=" & encrypt(value)

'getting
dim strvalue as string = request.querystring("id")
strvalue=decrypt(strvalue)

but in datagrid, i can't find the way to do it.


please also suggest if there is some alternative method to it.

thankx in advance.
 
S

Svein Terje Gaup

For the encryption, you might want to try to use DPAPI (Data Protection API)
which is a part of Windows 2000, XP and 2003.

This article describes "How to create a DPAPI library":
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod21.asp

I do not know exactly what you should do about your datagrid problem. You
might get the data into a dataset or datatable, then add an extra column
containing the url's the way you want them, and then databind that
table/dataset to the datagrid.

Sincerely
Svein Terje Gaup
 
D

David Coe, MCP

There is nothing wrong with using your own en/decrpytion methods ... so long as you are using some of the built in classes in the System.Security.Cryptography namespace. Using the aspnet_setreg.exe utility will not help you with this, since it is intended to encrypt items from your web.config file and store them in the registry.

The DPAPI may work, and does an excellent job of managing keys for you, but I have only seen that used in cases where you are encrypting items to be stored in the web.config file ... I have not seen it used for on the fly encryption, but I'm not saying it's not possible

To answer your other question regarding encrypting the URL in the DataGrid, you could use the code behind support and select the column and set the URL appropriately, such as

((HyperLinkColumn) grid.Columns[0]).NavigateUrl = "mypage.aspx?id=" + encrypt(value)
 
R

Raheel Hussain

the DPAPI helps a lot.

Now i m gonna try it on the grid hyperlink field as David said.

thx a lot guyz for the help.

regards
raheel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Encryption 11
QueryString encryption 3
QueryString to Textbox 0
Dotnetnuke Password Encryption 0
QueryString value 0
Cookie encryption? 7
Session Querystring 0
public key encryption 0

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top