
在html中对数据进行加密的方法有以下几种
1.md5加密
使用方法:
<html><head>
<meta charset="utf-8">
<title>md5加密</title>
[removed][removed]
[removed]
var hash = hex_md5("123dafd");
alert(hash)
[removed]
</head>
<body>
</body>
</html>
2.sha1加密
使用方法:
<html><head>
<meta charset="utf-8">
<title>sha1加密</title>
[removed][removed]
[removed]
var sha = hex_sha1('mima123465')
alert(sha)
[removed]
</head>
<body>
</body>
</html>
3.base64加密
使用方法:
<html><head>
<meta charset="utf-8">
<title>base64加密</title>
[removed][removed]
[removed]
var b = new Base64();
var str = b.encode("admin:admin");
alert("base64 encode:" + str);
//解密
str = b.decode(str);
alert("base64 decode:" + str);
[removed]
</head>
<body>
</body>
</html>