简体   繁体   English

javascript中的加密和Ruby中的解密

[英]encryption in javascript and decryption in Ruby

i need to encrypt a string in a client using javascript and need to decrypt it in a Ruby on Rails Server. 我需要使用javascript在客户端中加密字符串,并需要在Ruby on Rails Server中对其进行解密。

i want to use AES. 我想使用AES。

What are the best couple of script/library/method to do this? 最好的脚本/库/方法对是什么?

Think hard about what exactly you need to do this for. 认真考虑一下您到底需要做什么。

If you need to ensure that the data from your page that the user has input is transmitted securely to the server without being interceptable and decryptable on the way through and you want to be confident about doing that, then the obvious, well tested and well maintained way of doing that is to use HTTPS for your communications. 如果您需要确保用户输入的页面数据安全地传输到服务器,而不会在途中被截获和解密,并且您对此充满信心,那么显而易见的,经过良好测试和良好维护的这样做的方法是使用HTTPS进行通信。

If you want to do AES on your page for giggles, then this question covers AES on the client and Ruby can talk to OpenSSL pretty easily on the server. 如果您想在页面上进行AES咯咯笑,那么此问题将涵盖客户端上的AES,而Ruby可以在服务器上轻松地与OpenSSL进行通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM