开发者

How to encrypt url in javascript and decrypt in c# [duplicate]

This question already has answers here: Encrypt IDs in URL variables (5 answers) Closed 7 years ago.
var url = "DocumentId="+DocumentID+"&SectionType=1&RecID="+RecipientID;
window.open ( "../EBox/ShowLetter.aspx?Url="+encodeURIComponent(url),'PrintMail' , features );

Instead of encodi开发者_运维问答ng I want ot encrypt the url . What is the solution for this?


If it has to be secure, javascript is the wrong place to go. Anything done in javascript will be visible to a hacker, who will easily get an encrypted string.


Use HTTP with SSL (HTTPS). Everything sent between the client and the server (including the URL in the HTTP GET request) will be encrypted.

Obviously, this won't hide the data from the user, but since it starts in unencrypted form in the browser (the data you were planning to input into the JS encryption routine), nothing will.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜