18

用js实现md5加密

 3 years ago
source link: https://www.cnblogs.com/tuyile006/archive/2007/10/03/913399.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

用js实现md5加密


md5.js
   md4.js    sha1.js


使用MD5加密的方法:
下载md5.js文件,在网页中引用该文件:

<script type="text/javascript" src="md5.js"></script>

在你需要使用MD5加密的地方如此调用:

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

其他两个算法类似。

用javascript加密的好处是可以在客户端完成加密之后传送到服务端,
即可以减轻服务端负担,也可以保证传输的安全。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK