如何在asp.net 中加密查询字符串? [英] How to encrypt query strings in asp.net?

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

问题描述

如何在 aspx.net 中加密查询字符串?

How do I encrypt query strings in aspx.net?

附言我意识到这不提供安全性.我只是想混淆一个谜题.

P.S. I realize that this does not offer security. I'm just looking to obfuscate a puzzle.

P.P.S 虽然我将 CKret 的答案标记为正确答案(对于措辞的问题,我相信他的答案是最正确的).但是,就我自己而言,我将尝试使用 ChoasPandion 的加密替代方案.如果我需要更多安全性,我会查看 CKret 或 Ian 的.

P.P.S Though I marked CKret's answer as the correct one (for the question as worded I believe his is the most correct answer). However, for myself, I'm just going to try ChoasPandion's alternative to encryption. If I needed more security I'd look at CKret's or Ian's.

推荐答案

不要费心加密.只需将其转换为 base 64 字符串即可.

Don't bother encrypting it. Just convert it to a base 64 string.

string encoded = Convert.ToBase64String(Encoding.Unicode.GetBytes(myQueryStringValue));

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

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