使用 Javascript 加密并使用 C# 解密的简单算法
我想使用简单的 java 脚本算法加密 URL 中的一些文本,然后使用 C# 在 ASP.NET 页面的代码后面对其进行解密。
ROT13
是一个不错的选择,但不幸的是由于一些机密细节我无法使用它。任何类似的东西都会有帮助,但我不知道那些著名的。安全根本不是问题,只是以某种方式扭曲字符串并稍后检索它。
I want to encrypt some text in URL with a simple java-script algorithm and then decrypt it at code behind of an ASP.NET page using C#.
ROT13
is a good choice but unfortunately I cannot use it due to some confidential details. Anything like that would help but I don't know the famous ones. Security is not a matter at all, just twisting the string in some way and retrieve it later.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你想向谁隐瞒?最终用户还是在线监听的人?鉴于任何人都可以使用基于浏览器的调试器并在运行时检查变量,依赖加密来向最终用户隐藏信息并没有多大意义(除非您在将其发送到客户端之前对其进行加密)并且在将其发送回来之前不要对其进行解密)。如果您想隐藏网络上的信息,那么使用 SSL 绝对是最佳选择。
Who are you trying to hide it from? The end-user or someone listening on the wire? Given that anyone can use a browser-based debugger and inspect variables at run time, it doesn't really make much sense to rely on encryption to hide the information from the end-user (unless you encrypt it before you send it to the client and don't decrypt it until it's been sent back). If you're trying to hide the information on the wire, using SSL is definitely the way to go.
Javascript 和 C# 都支持许多不同的“真实”加密算法。
查看 Javascript DES 和 3DES
问题:经典 ASP 中的三重 DES 解密?
示例: http://jsbin.com/oguye3
来源: http://cheeso.members.winisp.net/srcview.aspx? dir=DES
DES 有已知的弱点,但该库还支持更强大的 3DES。
另请查看 Javascript 和 AES
让 .NET 中的 SlowAES 和 RijndaelManaged 类一起使用< /a>
这是浏览器中 AES 的工作演示:
http://jsbin.com/itiye5/3
Javascript and C# both support a number of different "real" encryption algorithms.
check out Javascript DES and 3DES
Question: Triple DES decryption in classic ASP?
example: http://jsbin.com/oguye3
source: http://cheeso.members.winisp.net/srcview.aspx?dir=DES
DES has known weaknesses, but that library also supports 3DES, which is stronger.
Also check out Javascript and AES
Getting SlowAES and RijndaelManaged class in .NET to play together
Here's a working demo of AES in the browser:
http://jsbin.com/itiye5/3
如果您正在寻找 RSA(非对称加密),您可以使用 jsbn http:// www-cs-students.stanford.edu/~tjw/jsbn/ JavaScript 库
用于客户端,标准 .Net RSACryptoServiceProvider 用于服务器端。
他们之间确实合作得很完美。
我希望这有帮助!
If you are looking for RSA (assymentric encryption) the you can use jsbn http://www-cs-students.stanford.edu/~tjw/jsbn/ javascript library
for client side and the standard .Net RSACryptoServiceProvider for server side.
They do cooperate perfectly between each other.
I hope this helps!
凯撒密码是一种非常简单的文本加密方法。或者您可以简单地将文本编码为 BASE64,这也使得人类难以阅读。 BASE64 自然不提供任何安全性,但您可以使用标准库进行编码和解码。
Caesar cipher is a quite simple method for encrypting a text. Or you could simply encode the text in BASE64, which also makes it hard to read for humans. BASE64 naturally offers no security at all, but you can use standard libraries for encoding and decoding.