File: PasswordDeriveBytes.xml

package info (click to toggle)
monodoc 1.9-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 98,436 kB
  • ctags: 5,261
  • sloc: xml: 1,506,218; cs: 40,827; sh: 3,647; perl: 554; makefile: 476
file content (343 lines) | stat: -rwxr-xr-x 18,461 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<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>1.0.5000.0</AssemblyVersion>
    <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>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete("see Rfc2898DeriveBytes for PKCS#5 v2 support")</AttributeName>
        </Attribute>
      </Attributes>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </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>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
  </Members>
  <Attributes>
    <Attribute>
      <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
    </Attribute>
  </Attributes>
</Type>