你怎么能保护/加密在asp.net中的查询字符串? [英] How can you secure/encrypt your querystring in asp.net?

查看:95
本文介绍了你怎么能保护/加密在asp.net中的查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道你怎么可以加密/解密您的查询字符串在一个简单的asp.net页面?
一些值需要在不同页面之间传递,但查询字符串不能更改或读取。

I was wondering how you could encrypt/decrypt your querystring in a simple asp.net page? some values need to be passed between different pages but the querystring cannot be changed or read.

有人说httphandles可能是这个解决方案。

Some say httphandles could be the solution for this.

有什么想法?

更多的背景信息:

喜THX所有的意见。
这就是问题所在,有时会消失,没有任何理由(当然必须有一个,但我不知道它)。我已经研究过可能的原因,但没有可能导致它发生。
因此,我不能依靠它了。
该cookie溶液的可能性,但是这将是更多的工作比单纯使用查询字符串来实现。
该URL可以在只是没有更改的任何时间被复制!

hi thx for all the comments. this is the problem, sometimes the sessions disappear without any reason (well there must be one but I don't know it yet). I've looked into the possible reasons but nothing that could cause it is happening. Therefore I cannot rely on it anymore. The cookie solution is a possibility but it will be more work to implement than simply using the querystring. The url can be copied at any time just not changed!

干杯,

推荐答案

您必须手动将其使用.net加密之一进行加密。真,这是不查询字符串是什么。如果你不希望用户能够访问它,你会发现它传递页面之间的不同的方式。

You'll have to encrypt it manually using one of the .Net encryptions. Really this isn't what the query string is for. If you don't want the users to be able to access it, you should find a different way of passing it between pages.

下面是一个项目,会告诉你如何做对称加密。
HTTP://www.$c$cproject.com/KB/security/SimpleEncryption的.aspx

Here is a project that will show you how to do symmetric encryption. http://www.codeproject.com/KB/security/SimpleEncryption.aspx

敢我提到这一点,因为这会造成显著的开销,但你可以在视图状态张贴您的信息,并使用跨页的职位是传递的信息:

Dare I mention this, because it will create significant overhead, but you can post your information in the view state and use cross page posts to pass the information around:

<一个href=\"http://www.velocityreviews.com/forums/t119789-view-state-in-$p$pvious-page-using-cross-page-postback.html\" rel=\"nofollow\">http://www.velocityreviews.com/forums/t119789-view-state-in-$p$pvious-page-using-cross-page-postback.html

这篇关于你怎么能保护/加密在asp.net中的查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆