Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The default hash algorithm type is SHA1. There are two ways that you can change this.</p> <p>1) If you are working with IIS 7 you can update this using the "Machine Key" configuration (shown below). This allows you to choose the encryption method from a list of available options and specify the keys or the key generation options.</p> <p><img src="https://i.stack.imgur.com/Uz6lV.png" alt="Machine Key configuration page from IIS 7 administration tool"></p> <p>2) If you are working with IIS 6 you can change the hash algorithm type using the membership element in the web.config file:</p> <pre><code>&lt;membership defaultProvider="provider name" userIsOnlineTimeWindow="number of minutes" hashAlgorithmType="SHA1"&gt; &lt;providers&gt;...&lt;/providers&gt; &lt;/membership&gt; </code></pre> <p>According to the documentation the string value of the <a href="http://msdn.microsoft.com/en-us/library/1b9hw62f(VS.85).aspx" rel="noreferrer">hashAlgorithmType</a> attribute can be any of the provided .Net hashing algorithm types. A bit of digging shows that the valid values for ASP.Net 2, 3 and 3.5 are <code>MD5</code>, <code>RIPEMD160</code>, <code>SHA1</code>, <code>SHA256</code>, <code>SHA384</code>, <code>SHA512</code>. The important part here is that all these classes inherit from <code>HashAlgorithm</code>.</p> <p>The value of the <a href="http://msdn.microsoft.com/en-us/library/1b9hw62f(VS.85).aspx" rel="noreferrer">hashAlgorithmType</a> attribute can also be an entry from the <a href="http://msdn.microsoft.com/en-us/library/ff3k1hh4.aspx" rel="noreferrer">cryptoNameMapping</a> element in the machine.config file. You could use this if you require a 3rd party hashing algorithm. The machine.config file can typically be found in <code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG</code> if you are using ASP.Net 2 or later. You can read more about setting these values <a href="http://msdn.microsoft.com/en-us/library/693aff9y.aspx" rel="noreferrer">here</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload