简体   繁体   English

在提交之前用javascript加密密码是否有意义?

[英]does it make sense to encrypt a password in javascript before submit?

I'm following the example on http://marakana.com/blog/examples/php-implementing-secure-login-with-php-javascript-and-sessions-without-ssl.html 我在http://marakana.com/blog/examples/php-implementing-secure-login-with-php-javascript-and-sessions-without-ssl.html上关注这个例子

The thing I don't fully understand is what is the gain by doing this? 我不完全明白的是这样做有什么好处? The secret word is posted in the form, so anyone who might be sniffing would surely see that secret word, as well as the javascript and be able to figure out the password anyways. 秘密的单词张贴在表单中,所以任何可能正在嗅探的人肯定会看到这个秘密单词,以及javascript,并且无论如何都能找出密码。 Does it really make sense to do this? 这样做真的有意义吗?

An eavesdropper would not be able to derive the password, because they only know: 窃听者无法获取密码,因为他们只知道:

  • the secret word 秘密的话
  • the hash of the secret word/password combination 秘密字/密码组合的哈希值

Since hashes are one-way, you cannot derive the password itself from these. 由于哈希是单向的,因此您无法从这些哈希中获取密码。

What you gain : The user has set up a password which the server is able to verify, without having to send the plaintext password itself. 您获得的 :用户设置了服务器能够验证的密码,而无需自行发送明文密码。

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

相关问题 SSL替代 - 使用JavaScript加密密码提交给PHP解密 - SSL Alternative - encrypt password with JavaScript submit to PHP to decrypt 在JavaScript中使用===进行字符串比较是否有意义? - Does it make sense to use === for string comparison in JavaScript? 表单提交前Javascript加密密码 - Javascript encrypting password before form submit 是否可以使用JavaScript加密密码? - Is it possible to encrypt the password in JavaScript? 尝试协助JavaScript垃圾收集器是否有意义? - Does it make sense to attempt to assist the JavaScript Garbage Collector? 在Java 8 Nashorn JavaScript引擎中同时加载脚本是否有意义 - Does it make sense to load scripts concurrently in Java 8 Nashorn JavaScript engine 什么时候在 Javascript 中使用双重相等(松散相等)有意义? - When does it make sense to use double equality (loose equality) in Javascript? 在前端 javascript 应用程序中使用 DI 容器是否有意义 - Does it make sense to use DI container in front end javascript app 在JavaScript块上使用HTML注释仍然有意义吗? - Does it still make sense to use HTML comments on blocks of JavaScript? 这个 Webhost 奇怪的 Javascript 解释有意义吗? - Does This Webhost's Odd Javascript-Explanation Make Sense?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM