Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>SecureString</strong> is what you are looking for. </p> <p>Never ever use a simple string object as it's not encrypted and can survive different garbage collections, which means your password will be flying all over the memory for a long time and you won't have control over it unless you dynamically assign GB Generation which can be quite evil. SecureString, instead, is automatically deleted when no longer in use.</p> <p>On the other hand when storing a password in the web.config always ENCRYPT it. You can use aspnet_regiis.exe for this. (It comes as part of the .NET Framework tools). </p> <p>So, assuming you are storing the password within an xml element called "DBAccessPassword" The encryption command would look something like this.</p> <pre><code>aspnet_regiis.exe -pe "DBAccessPassword" -app "/yourApp" </code></pre> <p>This is a very useful technique that could really makes the difference if, for example, your application is vulnerable to a <a href="http://www.owasp.org/index.php/Path_Traversal" rel="nofollow noreferrer">Path Traversal Vulnerability</a>. Encrypting a password is always a good idea as it adds an additional layer of security to your application.</p> <p><strong>Performances</strong></p> <p>aspnet_regiis uses RSA by default. RSA it is an asymmetric algorithm and because of this, depending of the amount of time you retrieve your password, it could lead to a performance problem. Symmetric-key algorithms are generally much less computationally intensive than asymmetric key algorithms. In practice, asymmetric key algorithms are typically hundreds to thousands times slower than symmetric key algorithms.</p> <p>Depending on the type of your application you would also consider using a different algorithm.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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