<Type Name="PasswordDeriveBytes" FullName="System.Security.Cryptography.PasswordDeriveBytes">
  <TypeSignature Maintainer="auto" Language="C#" Value="public class PasswordDeriveBytes : System.Security.Cryptography.DeriveBytes" />
  <AssemblyInfo>
    <AssemblyName>mscorlib</AssemblyName>
    <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement>
  <Base>
    <BaseTypeName>System.Security.Cryptography.DeriveBytes</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Implement PKCS #5 (Password-Based Cryptography Standard) password-based key derivation.</summary>
    <remarks>
      <para>Mono implements only PKCS#5 v1.5 in this class. On Microsoft's runtime the constructors and methods using CspParameters can be used to select a specific CSP for key derivation. The problem is that the "standard" MS CSP key derivation is undocumented and non-MS CSP may use different implementations as well.</para>
      <para>Using an undocumented key derivation algorithm for your product is a REALLY BAD idea.</para>
      <para>WARNING: See <see cref="M:System.Security.Cryptography.PasswordDeriveBytes.GetBytes" /> method for more informations about the security and interoperability issues when using this class.</para>
      <para>FX 2.0: Unless you must interoperate with PKCS#5 v.1.5 please use the newer Rfc2898DeriveBytes class which implements PKCS#5 v2.0.</para>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (byte[] password, byte[] salt);" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="password" Type="System.Byte[]" />
        <Parameter Name="salt" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="password">To be added.</param>
        <param name="salt">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (string strPassword, byte[] rgbSalt);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="strPassword" Type="System.String" />
        <Parameter Name="rgbSalt" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="strPassword">The password to be converted into a secret key.</param>
        <param name="rgbSalt">A salt (public random value) to be added to the derivation. This parameter helps to prevent pre-calculated dictionary attacks against the algorithm.</param>
        <summary>Create a new instance of PasswordDeriveBytes with a secret password and a salt value.</summary>
        <remarks>To be added</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (byte[] password, byte[] salt, System.Security.Cryptography.CspParameters cspParams);" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="password" Type="System.Byte[]" />
        <Parameter Name="salt" Type="System.Byte[]" />
        <Parameter Name="cspParams" Type="System.Security.Cryptography.CspParameters" />
      </Parameters>
      <Docs>
        <param name="password">To be added.</param>
        <param name="salt">To be added.</param>
        <param name="cspParams">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (string strPassword, byte[] rgbSalt, System.Security.Cryptography.CspParameters cspParams);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="strPassword" Type="System.String" />
        <Parameter Name="rgbSalt" Type="System.Byte[]" />
        <Parameter Name="cspParams" Type="System.Security.Cryptography.CspParameters" />
      </Parameters>
      <Docs>
        <param name="strPassword">The password to be converted into a secret key.</param>
        <param name="rgbSalt">A salt (public random value) to be added to the derivation. This parameter helps to prevent pre-calculated dictionary attacks against the algorithm.</param>
        <param name="cspParams">Parameters to select a Cryptographic Service Provider (CSP) to derive the bytes.</param>
        <summary>Create a new instance of PasswordDeriveBytes with a secret password and a salt value to be used with the specified CSP.</summary>
        <remarks>This constructor will always throw a <see cref="T:System.NotSupportedException" /> because Mono doesn't support the Cryptographic Service Provider (CSP) to derive new secret keys.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (byte[] password, byte[] salt, string hashName, int iterations);" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="password" Type="System.Byte[]" />
        <Parameter Name="salt" Type="System.Byte[]" />
        <Parameter Name="hashName" Type="System.String" />
        <Parameter Name="iterations" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="password">To be added.</param>
        <param name="salt">To be added.</param>
        <param name="hashName">To be added.</param>
        <param name="iterations">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (string strPassword, byte[] rgbSalt, string strHashName, int iterations);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="strPassword" Type="System.String" />
        <Parameter Name="rgbSalt" Type="System.Byte[]" />
        <Parameter Name="strHashName" Type="System.String" />
        <Parameter Name="iterations" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="strPassword">The password to be converted into a secret key.</param>
        <param name="rgbSalt">A salt (public random value) to be added to the derivation. This parameter helps to prevent pre-calculated dictionary attacks against the algorithm.</param>
        <param name="strHashName">The hash algorithm name to be used to derive new bytes.</param>
        <param name="iterations">The number of iterations done by the algorithm before returning any bytes.</param>
        <summary>Create a new instance of PasswordDeriveBytes with a secret password, a salt value, a hash algorithm and an iteration count.</summary>
        <remarks>To be added</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (byte[] password, byte[] salt, string hashName, int iterations, System.Security.Cryptography.CspParameters cspParams);" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="password" Type="System.Byte[]" />
        <Parameter Name="salt" Type="System.Byte[]" />
        <Parameter Name="hashName" Type="System.String" />
        <Parameter Name="iterations" Type="System.Int32" />
        <Parameter Name="cspParams" Type="System.Security.Cryptography.CspParameters" />
      </Parameters>
      <Docs>
        <param name="password">To be added.</param>
        <param name="salt">To be added.</param>
        <param name="hashName">To be added.</param>
        <param name="iterations">To be added.</param>
        <param name="cspParams">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public PasswordDeriveBytes (string strPassword, byte[] rgbSalt, string strHashName, int iterations, System.Security.Cryptography.CspParameters cspParams);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="strPassword" Type="System.String" />
        <Parameter Name="rgbSalt" Type="System.Byte[]" />
        <Parameter Name="strHashName" Type="System.String" />
        <Parameter Name="iterations" Type="System.Int32" />
        <Parameter Name="cspParams" Type="System.Security.Cryptography.CspParameters" />
      </Parameters>
      <Docs>
        <param name="strPassword">The password to be converted into a secret key.</param>
        <param name="rgbSalt">A salt (public random value) to be added to the derivation. This parameter helps to prevent pre-calculated dictionary attacks against the algorithm.</param>
        <param name="strHashName">The hash algorithm name to be used to derive new bytes.</param>
        <param name="iterations">The number of iterations done by the algorithm before returning any bytes.</param>
        <param name="cspParams">Parameters to select a Cryptographic Service Provider (CSP) to derive the bytes.</param>
        <summary>Create a new instance of PasswordDeriveBytes with a secret password, a salt value, a hash algorithm and an iteration count to be used with the specified CSP.</summary>
        <remarks>This constructor will always throw a <see cref="T:System.NotSupportedException" /> because Mono doesn't support the Cryptographic Service Provider (CSP) to derive new secret keys.</remarks>
      </Docs>
    </Member>
    <Member MemberName="CryptDeriveKey">
      <MemberSignature Language="C#" Value="public byte[] CryptDeriveKey (string algname, string alghashname, int keySize, byte[] rgbIV);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Byte[]</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="algname" Type="System.String" />
        <Parameter Name="alghashname" Type="System.String" />
        <Parameter Name="keySize" Type="System.Int32" />
        <Parameter Name="rgbIV" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="algname">To be added: an object of type 'string'</param>
        <param name="alghashname">To be added: an object of type 'string'</param>
        <param name="keySize">To be added: an object of type 'int'</param>
        <param name="rgbIV">To be added: an object of type 'byte []'</param>
        <summary>Use the key derivation algorithm provided by the specified Cryptographic Service Provider (CSP).</summary>
        <returns>An array of the specified length contaning bytes derived of the secret password and other (possibly public) informations.</returns>
        <remarks>This method isn't supported by Mono and will always throw a <see cref="T:System.NotSupportedException" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Finalize">
      <MemberSignature Language="C#" Value="~PasswordDeriveBytes ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>To be added</summary>
        <remarks>Internal state of the algorithm will be zeroized.</remarks>
      </Docs>
    </Member>
    <Member MemberName="GetBytes">
      <MemberSignature Language="C#" Value="public override byte[] GetBytes (int cb);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Byte[]</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="cb" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="cb">The length of derived bytes requested.</param>
        <summary>Request a buffer of derived bytes from the algorithm.</summary>
        <returns>An array of the specified length contaning bytes derived of the secret password and other (possibly public) informations.</returns>
        <remarks>
          <para>
SECURITY WARNING: You should never ask for more bytes than the <see cref="P:System.Security.Cryptography.PasswordDeriveBytes.HashName" /> digest algorithm can provide (e.g. 20 bytes maximum for SHA-1). This is the maximum you can get securely (i.e. don't try to get a 256 bits key using SHA-1). The PKCS#5 specification dictates to return an error if more is asked, however MS implementation does support it.
</para>
          <para>
INTEROPERABILITY WARNING: The previous undocumented behaviour isn't 100% compatible between Mono and MS implementation and should be avoided when possible. If it cannot be avoided try to call GetBytes once then split the bytes amongst multiple variables (e.g. key, iv) if required. This seems to be the safest way to interoperate between the two implementations.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="HashName">
      <MemberSignature Language="C#" Value="public string HashName { set; get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>The hash algorithm name to be used to derive new bytes.</summary>
        <value>The current hash algorithm used to derive bytes.</value>
        <remarks>Default hash algorithm is <see cref="T:System.Security.Cryptography.SHA1" /> and can provide, securely, up to 20 bytes of data.</remarks>
      </Docs>
    </Member>
    <Member MemberName="IterationCount">
      <MemberSignature Language="C#" Value="public int IterationCount { set; get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>The number of iterations done by the algorithm before returning any bytes.</summary>
        <value>The current iteration count.</value>
        <remarks>
          <para>This value can be ajusted to a balance so deriving a single key from a password is relatively fast (normal use) but very slow to use multiple times (e.g. attackers using a dictionary or a brute force attack). This makes the derivation algorithm stays "current" with newer and faster computer.</para>
          <para>Interoperability warning: The default iteration count is 1 to be compatible with Microsoft implementation. However this value is too low to be secure. Many other implementations use 1000 or 1024.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Reset">
      <MemberSignature Language="C#" Value="public override void Reset ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Reset the algorithm state to it's original state.</summary>
        <remarks>The next call to GetBytes will be identical to the first call.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Salt">
      <MemberSignature Language="C#" Value="public byte[] Salt { set; get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Byte[]</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>A salt (public random value) to be added to the derivation. </summary>
        <value>The current salt value being used to derive bytes.</value>
        <remarks>The salt value helps to prevent pre-calculated dictionary attacks against the algorithm.</remarks>
      </Docs>
    </Member>
  </Members>
  <Attributes>
    <Attribute>
      <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
    </Attribute>
  </Attributes>
</Type>
