使用 ajax 请求安全地发送密码

2022-01-22 00:00:00 passwords javascript ajax

只是想知道,是否可以通过 Ajax 请求安全地发送密码?

just to know, is it possible to send password through an Ajax request safely?

我有一个登录框,它调用 ajax 请求来尝试登录/传递并检索带有错误(如果有)的 JSON 对象.

I've a login box that calls an ajax request to try the login/pass and retrieve a JSON Object with errors (if any).

我应该改用表单重定向吗?

Should I use a form redirection instead?

将加密密码存储在数据库中不是解决方案,因为 ajax 发送的登录名和密码是访问数据库本身(内部应用程序)的登录名/密码.p>

Store the encrypted password in the database isn't the solution because the login and password send by ajax are the login / password to access the database itself (internal application).

推荐答案

发送无法被第三方拦截的东西的唯一方法是使用 HTTPS 而不是常规的 HTTP.这样一来,服务器和客户端之间发送的所有内容都是高度加密的.

The only way to send something that can not be intercepted by a third party is by using HTTPS instead of regular HTTP. That way everything sent between the server and the client is strongly encrypted.

相关文章