|
21 | 21 | ## Remarks |
22 | 22 | ASP.NET uses a hash-based message authentication code (HMAC) to help detect whether data that is used for forms authentication or view state has been tampered with. The HMAC is generated when view state content is created, and the HMAC is checked on subsequent requests. The HMAC helps ASP.NET determine whether someone has changed data that is sent between the server and the client, but the data can be read by anyone as it travels through the Internet unless it is also encrypted. By default, view state is validated but not encrypted. For more information, see <xref:System.Web.UI.Page.ViewStateEncryptionMode%2A> and <xref:System.Web.UI.Page.RegisterRequiresViewStateEncryption%2A>. |
23 | 23 | |
24 | | - The <xref:System.Web.Configuration.MachineKeyValidation> enumeration lets you specify the algorithm that ASP.NET uses to create the HMAC. The default value is HMACSHA256. ASP.NET uses the value of the <xref:System.Web.Configuration.MachineKeySection.ValidationKey%2A> property with the selected algorithm to generate the HMAC. |
25 | | - |
26 | | - |
| 24 | + The `MachineKeyValidation` enumeration lets you specify the algorithm that ASP.NET uses to create the HMAC. The default value is `HMACSHA256`. ASP.NET uses the value of the <xref:System.Web.Configuration.MachineKeySection.ValidationKey%2A> property with the selected algorithm to generate the HMAC. |
27 | 25 | |
28 | 26 | ## Examples |
29 | 27 | The following code example shows how to use the <xref:System.Web.Configuration.MachineKeyValidation> enumeration. In the example, `configSection` is an instance of <xref:System.Web.Configuration.MachineKeySection>.This code example is part of a larger example provided for the <xref:System.Web.Configuration.MachineKeySection> class. |
|
59 | 57 | </ReturnValue> |
60 | 58 | <MemberValue>3</MemberValue> |
61 | 59 | <Docs> |
62 | | - <summary>Specifies that ASP.NET uses the <see langword="AES" /> (Rijndael) encryption algorithm.</summary> |
63 | | - <remarks> |
64 | | - <format type="text/markdown"><![CDATA[ |
65 | | - |
66 | | -## Remarks |
67 | | - Choose this option if you want to encrypt view state in your Web application. If you choose this option, the <xref:System.Web.Configuration.MachineKeySection.DecryptionKey%2A> property will be used for encryption and decryption, and the `HMACSHA1` hash algorithm will be used with the <xref:System.Web.Configuration.MachineKeySection.ValidationKey%2A> property for validation. |
68 | | - |
69 | | - ]]></format> |
70 | | - </remarks> |
| 60 | + <summary><para>Specifies that ASP.NET uses the <see langword="AES" /> (Rijndael) encryption algorithm. Choose this option if you want to encrypt view state in your Web application.</para><para>If you choose this option, the <see cref="P:System.Web.Configuration.MachineKeySection.DecryptionKey" /> property will be used for encryption and decryption, and the <see langword="HMACSHA1" /> hash algorithm will be used with the <see cref="P:System.Web.Configuration.MachineKeySection.ValidationKey" /> property for validation.</para></summary> |
71 | 61 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
72 | 62 | </Docs> |
73 | 63 | </Member> |
|
88 | 78 | </ReturnValue> |
89 | 79 | <MemberValue>7</MemberValue> |
90 | 80 | <Docs> |
91 | | - <summary>Specifies that ASP.NET uses a custom hashing algorithm.</summary> |
92 | | - <remarks> |
93 | | - <format type="text/markdown"><![CDATA[ |
94 | | - |
95 | | -## Remarks |
96 | | - The custom hashing algorithm can be implemented in any class that derives from <xref:System.Security.Cryptography.KeyedHashAlgorithm>. |
97 | | - |
98 | | - The custom algorithm is typically specified declaratively in the validation attribute of the element, in the format `alg:`*algorithm_name*. For information about how to specify a custom algorithm in code, see the <xref:System.Web.Configuration.MachineKeySection.ValidationAlgorithm%2A?displayProperty=nameWithType> property. |
99 | | - |
100 | | - ]]></format> |
101 | | - </remarks> |
| 81 | + <summary><para>Specifies that ASP.NET uses a custom hashing algorithm. The custom hashing algorithm can be implemented in any class that derives from <see cref="T:System.Security.Cryptography.KeyedHashAlgorithm" />.</para><para>The custom algorithm is typically specified declaratively in the <c>validation</c> attribute of the <see href="https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/w8h3skw9(v=vs.100)">machineKey</see> element, in the format <c>alg:`*algorithm_name*</c>. For information about how to specify a custom algorithm in code, see the <see cref="P:System.Web.Configuration.MachineKeySection.ValidationAlgorithm" /> property.</para></summary> |
102 | 82 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
103 | 83 | </Docs> |
104 | 84 | </Member> |
|
119 | 99 | </ReturnValue> |
120 | 100 | <MemberValue>4</MemberValue> |
121 | 101 | <Docs> |
122 | | - <summary>Specifies that ASP.NET uses the <see langword="HMACSHA256" /> hashing algorithm. This is the default value.</summary> |
123 | | - <remarks> |
124 | | - <format type="text/markdown"><![CDATA[ |
125 | | - |
126 | | -## Remarks |
127 | | - `HMACSHA256` is an SHA2 hashing algorithm that generates a 256-bit hash code. |
128 | | - |
129 | | - ]]></format> |
130 | | - </remarks> |
| 102 | + <summary>Specifies that ASP.NET uses the <see langword="HMACSHA256" /> hashing algorithm, which is an SHA2 hashing algorithm that generates a 256-bit hash code. This is the default value.</summary> |
131 | 103 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
132 | 104 | </Docs> |
133 | 105 | </Member> |
|
148 | 120 | </ReturnValue> |
149 | 121 | <MemberValue>5</MemberValue> |
150 | 122 | <Docs> |
151 | | - <summary>Specifies that ASP.NET uses the <see langword="HMACSHA384" /> hashing algorithm.</summary> |
152 | | - <remarks> |
153 | | - <format type="text/markdown"><![CDATA[ |
154 | | - |
155 | | -## Remarks |
156 | | - `HMACSHA384` is an SHA2 hashing algorithm that generates a 384-bit hash code. This option is available for applications that require stronger security than is provided by the `HMACSHA256` algorithm. |
157 | | - |
158 | | - ]]></format> |
159 | | - </remarks> |
| 123 | + <summary>Specifies that ASP.NET uses the <see langword="HMACSHA384" /> hashing algorithm, which is an SHA2 hashing algorithm that generates a 384-bit hash code. This option is available for applications that require stronger security than provided by the <see langword="HMACSHA256" /> algorithm..</summary> |
160 | 124 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
161 | 125 | </Docs> |
162 | 126 | </Member> |
|
177 | 141 | </ReturnValue> |
178 | 142 | <MemberValue>6</MemberValue> |
179 | 143 | <Docs> |
180 | | - <summary>Specifies that ASP.NET uses the <see langword="HMACSHA512" /> hashing algorithm.</summary> |
181 | | - <remarks> |
182 | | - <format type="text/markdown"><![CDATA[ |
183 | | - |
184 | | -## Remarks |
185 | | - `HMACSHA512` is an SHA2 hashing algorithm that generates a 512-bit hash code. This option is available for applications that require stronger security than is provided by the `HMACSHA384` algorithm. |
186 | | - |
187 | | - ]]></format> |
188 | | - </remarks> |
| 144 | + <summary>Specifies that ASP.NET uses the <see langword="HMACSHA512" /> hashing algorithm, which is an SHA2 hashing algorithm that generates a 512-bit hash code. This option is available for applications that require stronger security than provided by the <see langword=">HMACSHA384" /> algorithm.</summary> |
189 | 145 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
190 | 146 | </Docs> |
191 | 147 | </Member> |
|
207 | 163 | </ReturnValue> |
208 | 164 | <MemberValue>0</MemberValue> |
209 | 165 | <Docs> |
210 | | - <summary>Specifies that ASP.NET uses the Message Digest 5 (<see langword="MD5" />) hashing algorithm.</summary> |
211 | | - <remarks> |
212 | | - <format type="text/markdown"><![CDATA[ |
213 | | - |
214 | | -## Remarks |
215 | | - `MD5` is a hashing algorithm that generates a 128-bit hash value. This option is included for legacy purposes and should be selected only if compatibility with earlier versions of ASP.NET is required. |
216 | | - |
217 | | - ]]></format> |
218 | | - </remarks> |
| 166 | + <summary>Specifies that ASP.NET uses the Message Digest 5 (<see langword="MD5" />) hashing algorithm, which is a hashing algorithm that generates a 128-bit hash value. This is a legacy value that should be selected only if compatibility with earlier versions of ASP.NET is required.</summary> |
219 | 167 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
220 | 168 | </Docs> |
221 | 169 | </Member> |
|
237 | 185 | </ReturnValue> |
238 | 186 | <MemberValue>1</MemberValue> |
239 | 187 | <Docs> |
240 | | - <summary>Specifies that ASP.NET uses the <see langword="HMACSHA1" /> hash algorithm.</summary> |
241 | | - <remarks> |
242 | | - <format type="text/markdown"><![CDATA[ |
243 | | - |
244 | | -## Remarks |
245 | | - `HMACSHA1` is a hashing algorithm that generates a 160-bit hash value. This option is included for legacy purposes and should be selected only if compatibility with earlier versions of ASP.NET is required. |
246 | | - |
247 | | - ]]></format> |
248 | | - </remarks> |
| 188 | + <summary>Specifies that ASP.NET uses the <see langword="HMACSHA1" /> hash algorithm, which is a hashing algorithm that generates a 160-bit hash value. This is a legacy value that should be selected only if compatibility with earlier versions of ASP.NET is required.</summary> |
249 | 189 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
250 | 190 | </Docs> |
251 | 191 | </Member> |
|
267 | 207 | </ReturnValue> |
268 | 208 | <MemberValue>2</MemberValue> |
269 | 209 | <Docs> |
270 | | - <summary>Specifies that ASP.NET uses the TripleDES (<see langword="3DES" />) encryption algorithm.</summary> |
271 | | - <remarks> |
272 | | - <format type="text/markdown"><![CDATA[ |
273 | | - |
274 | | -## Remarks |
275 | | - TripleDES is an encryption algorithm that is used only if you specify that view state is encrypted. This option is included for legacy purposes and should be selected only if compatibility with earlier versions of ASP.NET is required. |
276 | | - |
277 | | - ]]></format> |
278 | | - </remarks> |
| 210 | + <summary>Specifies that ASP.NET uses the TripleDES (<see langword="3DES" />) encryption algorithm, which is an encryption algorithm that is used only if you specify that view state is encrypted. This is a legacy value that should be selected only if compatibility with earlier versions of ASP.NET is required..</summary> |
279 | 211 | <altmember cref="T:System.Web.Configuration.MachineKeyValidation" /> |
280 | 212 | </Docs> |
281 | 213 | </Member> |
|
0 commit comments