Password encryption at client side [duplicate]

2019-01-02 14:46发布

Possible Duplicate:
About password hashing system on client side

I have to secure the passwords of my web site users. What I did was use MD5 encryption hashing in server side. But the problem is the passwords remain in plain text until it arrives at the server, which means that the password can be captured using traffic monitoring. So what I want is to use a client side password encryption/hashing mechanism and send the encrypted/hashed password. Can anybody tell what is the way to do this?

9条回答
像晚风撩人
2楼-- · 2019-01-02 15:08

You've tagged this question with the tag, and SSL is the answer. Curious.

查看更多
怪性笑人.
3楼-- · 2019-01-02 15:11

There are MD5 libraries available for javascript. Keep in mind that this solution will not work if you need to support users who do not have javascript available.

The more common solution is to use HTTPS. With HTTPS, SSL encryption is negotiated between your web server and the client, transparently encrypting all traffic.

查看更多
低头抚发
4楼-- · 2019-01-02 15:14

You need a library that can encrypt your input on client side and transfer it to the server in encrypted form.

You can use following libs:

  • jCryption. Client-Server asymmetric encryption over Javascript

Update after 3 years:

Update after 4 years (Wohoo!)

Still not convinced? Neither am I :)

查看更多
伤终究还是伤i
6楼-- · 2019-01-02 15:20

For a similar situation I used this PKCS #5: Password-Based Cryptography Standard from RSA laboratories. You can avoid storing password, by substituting it with something that can be generated only from the password (in one sentence). There are some JavaScript implementations.

查看更多
心情的温度
7楼-- · 2019-01-02 15:22

This sort of protection is normally provided by using HTTPS, so that all communication between the web server and the client is encrypted.

The exact instructions on how to achieve this will depend on your web server.

The Apache documentation has a SSL Configuration HOW-TO guide that may be of some help. (thanks to user G. Qyy for the link)

查看更多
登录 后发表回答