Tip: Use JavaScript to implement MD5 local encryption

Source: Internet
Author: User
Tags implement md5
Javascript| Technique | Encryption md5($_POST['passwd'] This is the PHP general encryption method, passed over and the database originally encrypted MD5 code to compare


And the following method is through JS to achieve the MD5, in fact, this method in many other places have introduced, and yahoo,vbulletin and so on without the use of SSL encrypted login with this method, password encryption

In fact, there are other ways to encrypt some of the methods are also implemented: such as Md4/sha-1

First you're going to

MD5 JS Download Address/

Download a JS code of use

Call:

CODE:

<script type="text/javascript" src="md5.js"></script>To implement encryption:

CODE:

<script type="text/javascript" >
  hash = hex_md5("input string");
</script>
or just in

CODE:

<form >The advantage of doing this is

CODE:

1.通过这个md5的js生成的代码和php的是一样,减少服务器在md5加密的负担

2.因为密码是直接在客户端就进行加密,不像php要传到服务器端才加密,这样传输过程的安全也得到进一步的加强
I hope these tips will help us.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.