Skip to content

Clarify key length parameter #11246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions xml/System.Security.Cryptography/Rfc2898DeriveBytes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ For more information about PBKDF2, see [RFC 2898](https://www.rfc-editor.org/inf
<param name="salt">The key salt used to derive the key.</param>
<param name="iterations">The number of iterations for the operation.</param>
<param name="hashAlgorithm">The hash algorithm to use to derive the key.</param>
<param name="outputLength">The size of key to derive.</param>
<param name="outputLength">The size of the key to derive, in bytes.</param>
<summary>Creates a PBKDF2 derived key from password bytes.</summary>
<returns>A byte array containing the created PBKDF2 derived key.</returns>
<remarks>To be added.</remarks>
Expand Down Expand Up @@ -1100,7 +1100,7 @@ For more information about PBKDF2, see [RFC 2898](https://www.rfc-editor.org/inf
<param name="salt">The key salt used to derive the key.</param>
<param name="iterations">The number of iterations for the operation.</param>
<param name="hashAlgorithm">The hash algorithm to use to derive the key.</param>
<param name="outputLength">The size of key to derive.</param>
<param name="outputLength">The size of the key to derive, in bytes.</param>
<summary>Creates a PBKDF2 derived key from password bytes.</summary>
<returns>A byte array containing the created PBKDF2 derived key.</returns>
<remarks>To be added.</remarks>
Expand Down Expand Up @@ -1207,17 +1207,15 @@ For more information about PBKDF2, see [RFC 2898](https://www.rfc-editor.org/inf
<param name="salt">The key salt used to derive the key.</param>
<param name="iterations">The number of iterations for the operation.</param>
<param name="hashAlgorithm">The hash algorithm to use to derive the key.</param>
<param name="outputLength">The size of key to derive.</param>
<param name="outputLength">The size of the key to derive, in bytes.</param>
<summary>Creates a PBKDF2 derived key from a password.</summary>
<returns>A byte array of length <paramref name="outputLength" /> that is filled with pseudo-random key bytes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

The `password` will be converted to bytes using the UTF8 encoding. For
other encodings, convert the password string to bytes using the appropriate <xref:System.Text.Encoding>
and use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte},System.Int32,System.Security.Cryptography.HashAlgorithmName,System.Int32)>.
The `password` is converted to bytes using the UTF8 encoding. For other encodings, convert the password string to bytes using the appropriate <xref:System.Text.Encoding> and use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte},System.Int32,System.Security.Cryptography.HashAlgorithmName,System.Int32)>.

]]></format>
</remarks>
Expand Down Expand Up @@ -1332,17 +1330,15 @@ The `password` will be converted to bytes using the UTF8 encoding. For
<param name="salt">The key salt used to derive the key.</param>
<param name="iterations">The number of iterations for the operation.</param>
<param name="hashAlgorithm">The hash algorithm to use to derive the key.</param>
<param name="outputLength">The size of key to derive.</param>
<param name="outputLength">The size of the key to derive, in bytes.</param>
<summary>Creates a PBKDF2 derived key from a password.</summary>
<returns>A byte array of length <paramref name="outputLength" /> that is filled with pseudo-random key bytes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

The `password` will be converted to bytes using the UTF8 encoding. For
other encodings, convert the password string to bytes using the appropriate <xref:System.Text.Encoding>
and use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(System.Byte[],System.Byte[],System.Int32,System.Security.Cryptography.HashAlgorithmName,System.Int32)>.
The `password` is converted to bytes using the UTF8 encoding. For other encodings, convert the password string to bytes using the appropriate <xref:System.Text.Encoding> and use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(System.Byte[],System.Byte[],System.Int32,System.Security.Cryptography.HashAlgorithmName,System.Int32)>.

]]></format>
</remarks>
Expand Down