471,338 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

enableViewStateMAC and 3DES

Hi,

I am trying to encrypt viewstate in my ASP.NET web site.
I put these items in the web.config..

<pages enableViewStateMac="true" />
<machineKey validation="3DES"/>

However, when I tried to access the .NET pages, I encountered the ff error:

"Specified key is not a valid size for this algorithm"

What could be wrong?

Help from anyone will be much appreciated!

Thanks!

Mayet
Jul 21 '05 #1
3 4875
Simang,

I'm not sure if this will solve your problem but try adding the following
attributes to your <machineKey> element:

<machineKey validationKey="AutoGenerate,IsolateApps"
decryptionKey="AutoGenerate,IsolateApps"
validation="3DES"/>

If your app is running in a web farm, you'll need to generate a unique key
for both the validationKey and decryptionKey attributes.

http://support.microsoft.com/default...b;en-us;312906

HTH,
Jorge

"Simang" wrote:
Hi,

I am trying to encrypt viewstate in my ASP.NET web site.
I put these items in the web.config..

<pages enableViewStateMac="true" />
<machineKey validation="3DES"/>

However, when I tried to access the .NET pages, I encountered the ff error:

"Specified key is not a valid size for this algorithm"

What could be wrong?

Help from anyone will be much appreciated!

Thanks!

Mayet

Jul 21 '05 #2
Hi! Thanks for the reply.
I tried your suggestion but unfortunately, its still not working :(

What's really puzzling is that I tried it with another PC, same PC
specs, same dotnet version but it worked.
Im really stumped now.. could this be some other configuration? in the
web.config or machine.config perhaps?

Any help will be appreciated...

Thanks!

Mayet

Jul 21 '05 #3
Mayet,

Did you try generating keys for the machineKey using the link I sent you?

http://support.microsoft.com/default...b;en-us;312906

Make sure you use 24 for 3DES as input to the code in the above kb article.

HTH,
Jorge

"ma******@gmail.com" wrote:
Hi! Thanks for the reply.
I tried your suggestion but unfortunately, its still not working :(

What's really puzzling is that I tried it with another PC, same PC
specs, same dotnet version but it worked.
Im really stumped now.. could this be some other configuration? in the
web.config or machine.config perhaps?

Any help will be appreciated...

Thanks!

Mayet

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Simang | last post: by
2 posts views Thread by Simang | last post: by
1 post views Thread by tshad | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.