How do we ensure view state is not tampered?
-
'ViewStateMac' property to false
-
'EnableViewStateMac' property to false
-
'EnableViewStateMac' property to True
-
'ViewStateMac' property to true
EnableViewStateMac set to True enables MAC (Message Authentication Code) generation to detect view state tampering. Setting it to false would disable tamper detection, making the application vulnerable to view state manipulation attacks.
To ensure that the view state is not tampered with, we need to enable the ViewStateMac property.
Option A) 'ViewStateMac' property to false - This option is incorrect because setting the ViewStateMac property to false would disable the view state message authentication code (MAC), which is used for tamper detection.
Option B) 'EnableViewStateMac' property to false - This option is incorrect because setting the EnableViewStateMac property to false would also disable the view state MAC, which is required for tamper detection.
Option C) 'EnableViewStateMac' property to True - This option is correct because setting the EnableViewStateMac property to True enables the view state MAC, which helps in preventing tampering.
Option D) 'ViewStateMac' property to true - This option is incorrect because there is no ViewStateMac property. The correct property name is EnableViewStateMac.
The correct answer is C) 'EnableViewStateMac' property to True. This option is correct because enabling the view state MAC helps ensure that the view state is not tampered with.