Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Saturday, September 02, 2006

Machine Key Generator in ASP.NET

This tool allows you to generate random keys for valdiation and ecnryption/decryption of the view state. It builds a <machineKey> element which you need to include in your web.config file.

The validation key should be in the range of 20 to 64. Decryption key—8 or 24. Between SHA1 and MD5 algorithms used for validation SHA1 produces a longer key and is therefore recommended. The tool creates a 8-byte key for the Data Encryption Algorythm (DES) and a 24-byte one for Triple-DES (3DES).

Once keys are generated they are converted into a string of hexadecimal characters.

for the input 64, 24, SHAI

Example <machineKey validationKey="46C62C2383DBB2F8E148C48405734FABC2118A2
3EA815591B1DD02F1" validation="SHA1" />

Get the Tool

Post a Comment