通过javascript加密查询字符串的参数 [英] encrypting parameters of a querystring via javascript

查看:157
本文介绍了通过javascript加密查询字符串的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想重定向到带有querystring的页面,并且querystring值应为加密格式,并且我想在codebehind中对其解密

例如:

Hi,

I want to redirect to some page with querystring,and the querystring value should be in encrypted format and i want to decrypt that in codebehind

example:

function redirect(s, e)
{
   window.location.href = "Default2.aspx?Id=" + encrypt(5)+ "&No=" +encrypt( 5);
}



并在代码背后:



and in codebehind:

Dim id As String = Request.QueryString("Id").ToString()
        id = Decode(id)
Dim no As String = Request.QueryString("No").ToString()
        no= Decode(no)



在此先感谢

Arasu Rajendran



Thanks in Advance

Arasu Rajendran

推荐答案

您好..

.NET本机支持最常见的加密算法,并允许您添加对更多加密算法的支持,因此真正重要的是您可以在JavaScript中执行的操作.

试试这个链接
http://www.vincentcheung.ca/jsencryption/ [
Hi there..

.NET supports most common encryption algorithms natively and allows you to add support for more, so all that really matters is what you can do in JavaScript.

try this link
http://www.vincentcheung.ca/jsencryption/[^]


尝试加密JavaScript中的任何内容确实没有意义.请记住,该代码将在客户端浏览器中运行,并且用户将拥有对它的完全访问权限,因此非常非常容易进行欺骗.
There really is no point in trying to encrypt anything in the JavaScript. Remember this code would be run in the client browser and the user would have full access to it making it very, very easy to spoof.


这篇关于通过javascript加密查询字符串的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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