As for encrypting the query string, I can really come up with a number of reasons for encrypting it. Probably the classic case would be where you created a grid filled with unique indexes of people's records. On each line, you may want to have a link to a page that allows you to edit the entry. You can simply provide each link with an argument such as "ID = X" to load the corresponding entry.
John | Sample | <a href="EditPage.aspx?ID=1">Edit Me!</a> Jane | Sample | <a href="EditPage.aspx?ID=2">Edit Me!</a>
Now this is not a problem if all employees have access to all personnel. And access to your page is encrypted by the authentication process. And you use SSL (SSL is consistent and all communication is encrypted before any URL arguments are sent). However, consider the case where you have restrictions by which users can see which entries. Thus, Chicago employees can only see people assigned to Chicago, New York employees can only see New York staff, etc.
Now you have a problem: someone may compromise your location restriction by simply retyping the URL with a different user ID. One way to do this is to encrypt the request arguments. However, there are a few twists and turns. First, simple encryption will not work, because the user can simply try a different encrypted value. You need paired pairs or an algorithm that has led to an extremely sparse mapping between identifiers and URL arguments. The key solution (which I used and recommend) is simple: just pass in two encrypted complex values that work together to produce a valid value.
Please note that you cannot get around this through session storage because you do not know what value the user will choose ahead of time. Similarly, Post will be very awkward when dealing with such a simple interface.
In relation to your situation, the above shows a specific situation where it would be useful. Whether it is applicable in your case, you decide. However, you should consider whether encryption uses only one valid value for another.
Another note: viewstate is not encrypted by default. It is just encoded via Base64 . A hash has been added so you can see if it has been changed.
Regarding the security of your web application, the only reliable way to ensure that the data you receive comes from your user and that the data is not compromised during the transfer is SSL.
Mark brittingham
source share