使用 SSL 证书时是否需要对 ASP.NET 视图状态隐藏字段进行加密/编码?
如果您有网站的 SSL 证书,是否有必要使 ViewState 更难以解码。在没有任何额外开发的情况下,ASP.NET 似乎将其编码为 Base 64 字符串。我找到了一些示例代码来轻松解码这个隐藏字段“__VIEWSTATE”。 SSL 不会为您加密此内容(以及其他内容)吗?
PS:如果这是发布此问题的错误网站,请告诉我。我在安全站点上也有它,但我不知道他们对 Web 应用程序和 ASP.NET 了解多少。
If you have an SSL certificate for a web site, is it necessary to make the ViewState more difficult to decode. Without any extra development, it appears that ASP.NET encodes it as a base 64 string. I found some sample code to easily decode this hidden field "__VIEWSTATE". Doesn't SSL encrypt this (along with other things) for you?
PS: If this is the incorrect site to post this question, please let me know. I also have it on the Security site, but I don't know how much they know about web applications and ASP.NET.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SSL 将在传输过程中对数据进行加密。当数据在服务器和浏览器之间移动时,包括视图状态。
如果您觉得有必要,您可以在该页面上执行更多操作。当浏览器查看页面时,页面已安全地传输到浏览器 - 您是否认为需要保护浏览器的视图状态不被使用者访问?
SSL will encrypt the data during transport. When the data is moving between the server and browser, including the view state.
It is up to you to do more on the page, if you feel the need. At the point that a browser is viewing the page, it has been transferred securely to the browser - do you feel that you need to protect the view state from the person using the browser?
永远不要在 ViewState 中存储敏感数据!
< strong>附录
如果您没有在 ViewState 中存储敏感数据,则不必担心对其进行加密或解密。它只会增加不必要的开销。
You should not store sensitive data in the ViewState, ever!
Addendum
If you're not storing sensitive data in the ViewState, then don't worry about encrypting or decrypting it. It will just add unnecessary overhead.