Encrypt the ViewState

By Emanuele Bartolesi at March 20, 2009 04:45
Filed Under: Asp.net, C#

By default, the ViewState encryption is disabled in the web applications.
So it is recommended not send private data through Viewstate at least that you are not using SSL.
There are two ways to encrypt your ViewState:
1. Encrypt ViewState in every Page
2. Encrypt ViewState in web.config for all pages in your applications In the first case, add the attribute in the directive <%@Page ViewStateEncryptionMode="Always" %> in your single page.
In the second case, add the attribute viewSateEncryptionMode="Always" in your web.config.
Then add the algorithm of decryption in your web.config.
There are much key of decryption, but the key AES is the best for performance and for security.

See the example:

<configuration>
<system.web>
<machineKey decryptionKey="AutoGenerate,IsolateApps" decryption="AES" />
</system.web>
</configuration>

For more informations go to http://msdn2.microsoft.com/en-us/library/ms998288.aspx

Comments

9/18/2009 11:39:12 AM #

Nice post, just saved your RSS feed. Will check back later.. Cheers m8.

Storbyferie

11/5/2009 9:17:35 PM #

Perhaps it becomes the first time I visit your blog, yet I know it contains so many useful things here. thanks a lot.

kerja keras adalah energi kita United States

11/8/2009 2:52:54 AM #

Just wanted to say thanks for this.

payday loans United States

11/25/2009 5:05:40 AM #

Can you please provide more information on this topic??? Also your blog is fantastic. Take care.

free game

11/25/2009 8:34:28 AM #

Warner Wells United States

11/27/2009 5:32:21 AM #

I found your site from google and it is very informative. Thnx for sharing such an amazing post!!!

online game

11/28/2009 2:39:34 PM #

Nice knowledge gaining article. But in my honest opinion, out of the 3 big search engines: Google, Bing and Yahoo.. Google is unbeatable. The war between the search engines are on for long time but Google still rules in this thing. Loved reading your blog & bookmarked- Jenniffer

Watch Free Movies United States

About me

I will also give you some useful tips, based on the modest wisdom gained during the years that I've worked as a developer and project manager.

Widget

Ohloh profile for Emanuele Bartolesi

 

Wakoopa

Software tracking

 

Software tracking

from Amazon



hacker emblem



Scarica il pdf di Game
Rivista Game di videogiochi
Trucchi videogiochi