1. base64 Encryption
Introduce the base64.js file to the page. The call method is as follows:
<! Doctype HTML>
<HTML>
<Head>
<Meta charset = "UTF-8">
<Title> base64 encryption </title>
<SCRIPT type = "text/JavaScript" src = "base64.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
VaR B = new base64 ();
VaR STR = B. encode ("Admin: admin ");
Alert ("base64 encode:" + Str );
// Decrypt
STR = B. Decode (STR );
Alert ("base64 Decode:" + Str );
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
2. MD5 Encryption
REFERENCE The md5.js file on the page. The call method is
<! Doctype HTML>
<HTML>
<Head>
<Meta charset = "UTF-8">
<Title> MD5 encryption </title>
<SCRIPT type = "text/ecmascript" src = "md5.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
VaR hash = hex_md5 ("123 dafd ");
Alert (hash)
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
3. sha1 Encryption
It is said that this is the most secure encryption
When sha1.js is introduced to the page, the call method is
<! Doctype HTML>
<HTML>
<Head>
<Meta charset = "UTF-8">
<Title> sha1 encryption </title>
<SCRIPT type = "text/ecmascript" src = "sha1.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
VaR Sha = hex_sha1 ('ma123465 ')
Alert (SHA)
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
Base64.js
Md5.js
Sha1.js