الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

اين موقع الhash code في ال viewstate ?

بدأه mmmmm_gsa في 24 نوفمبر 2012 · 0 رد · 414 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1

بسم الله الرحمن الرحيم

في صفحات ال asp.net وعندما يتم ارسال الصفحة من السيرفر الى المستخدم

وعند قيام المستخدم بالحصول على مصدر الصفحة (في متصفح فايرفوكس ctrl+u)

سيجد حقلا ان جازت التسمية على هذا النحو

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLThgghg........"

فسؤالي كيف يمكنني التمييز بين الviewstate وال hash code

وايضا وجدت في بعض المواقع ان عملية انشاء ال hash code تتم بواسطة machine authentication code (MAC) key

ولكن كيف يمكنني تعديل هذا ال machine authentication code (MAC) key ؟

هذة الفقرة من موقع msdn

Usign the MAC for Computing the View State Hash Value

The MAC key that is used to compute the view state hash value is either auto-generated or specified in the Machine.config file. If the key is auto-generated, it is created based on the MAC address of the computer, which is the unique GUID value of the network adapter in that computer.

It can be difficult for malicious users to reverse-engineer the MAC key based on the hash value in view state. Thus, MAC encoding is a reasonably reliable way to determine whether view state data has been changed.

In general, the larger the MAC key that is used to generate the hash, the less likely it is that the hash value for different strings will be the same. When the key is auto-generated, ASP.NET uses SHA-1 encoding to create a large key. However, in a Web-farm environment, the key must be the same across all the servers. If the key is not the same, and the page is posted back to a different server than the one that created the page, the ASP.NET page framework will raise an exception. Therefore, in a Web farm environment, you should specify a key in the Machine.config file instead of letting ASP.NET auto-generate one. In that case, make sure that you create a key that is long enough to offer sufficient security for the hashed value. However, the longer the key is, the more time it takes to create a hash. Therefore, you must weigh security needs versus performance needs.

شكرا مقدما

وللعلم اريد استخدام ال mac في تطبيقات ويندوز؟

12345157268.jpg

مواضيع مشابهة