enableViewStateMAC and 3DES

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simang

    #1

    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 enableViewState Mac="true" />
    <machineKey validation="3DE S"/>

    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
  • Jorge Matos

    #2
    RE: enableViewState MAC and 3DES

    Simang,

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

    <machineKey validationKey=" AutoGenerate,Is olateApps"
    decryptionKey=" AutoGenerate,Is olateApps"
    validation="3DE S"/>

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



    HTH,
    Jorge

    "Simang" wrote:
    [color=blue]
    > Hi,
    >
    > I am trying to encrypt viewstate in my ASP.NET web site.
    > I put these items in the web.config..
    >
    > <pages enableViewState Mac="true" />
    > <machineKey validation="3DE S"/>
    >
    > 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
    >[/color]

    Comment

    • mayetski@gmail.com

      #3
      Re: enableViewState MAC and 3DES

      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

      Comment

      • Jorge Matos

        #4
        Re: enableViewState MAC and 3DES

        Mayet,

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



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

        HTH,
        Jorge

        "mayetski@gmail .com" wrote:
        [color=blue]
        > 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
        >
        >[/color]

        Comment

        Working...