javascript加密? [英] javascript encryption?

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

问题描述

我不想使用 HTTPS

http://www.vector.safwanmanpower.com/

填写用户名并单击任何按钮,然后单击显示按钮您将在警报框中获得任何序列,例如 2-4-5-7,这是我使用生成的序列javascript 现在我想提交这个序列以保存在正在工作的数据库中,但是当我发送这个序列时,它将以纯文本格式输入我想加密这个序列,然后使用 php 在服务器上解密它并保存为 2-4-5-7 在数据库中?

fill the username and click on any of buttons then click on show button you will get any sequence like 2-4-5-7 in alert box this sequence i've generated using javascript now i want to submit this sequence to save in database that is working but when i send this sequence it will go in plain text i want to encrypt this sequence and then decrypt it on server using php and save as it is 2-4-5-7 in database ?

我怎样才能做到这一点,任何 javascript 加密都不能被认为是 javascript 代码对用户可见?

how can i do this any javascript encryption which can't be consider as weak as javascript code is visible to user ?

所以中间人嗅探会很困难

so middle man sniffing will be difficult

在上面的示例中,我如何使用 javascript 加密并使用 php 解密并存储在 db 中?

how can i encrypt using javascript and decrypt it using php and store in db in above example ?

任何其他解决方案都会帮助我

any other solution will help me

推荐答案

为什么你想要这个加密的客户端,只在服务器端解密它,有什么特别的原因吗?如果您想防止数据被客户端和服务器之间的链接捕获,我建议改用 SSL.HTTPS 协议是保护从客户端发送到客户端的数据的好方法.

Is there any particular reason on why you want this encrypted client-side, only to decrypt it server-side? If you want to prevent the data from being caught by links between the client and the server, I'd suggest using SSL instead. The HTTPS protocol is a good way of securing the data being sent from and to the client.

这篇关于javascript加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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