13

What encryption method does the .NET FormsAuthentication.Encrypt() method use?

There's no mention in the MSDN article:

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.encrypt.aspx

Thanks.

1 Answer 1

18

This is defined by the machineKey element:

<system.web>
    <machineKey validationKey="..." 
                decryptionKey="..." 
                validation="SHA1"
                decryption="AES" />
</system.web>
Sign up to request clarification or add additional context in comments.

3 Comments

What if my machine.config does not have a machine key as you said in you reply. then which algorithm does .net use as default?.
I find no machineKey setting in my machine and local server, any idea of what algorithm is used by default in this condition?.
From the same page: it defaults to SHA1, which uses the HMACSHA1 algorithm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.