1、base64加密
在页面中引入base64.js文件,调用方法为:
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>base64加密</title> <script type="text/javascript" src="/UploadFiles/2021-04-02/base64.js">2、md5加密
在页面中引用md5.js文件,调用方法为
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>md5加密</title> <script type="text/ecmascript" src="/UploadFiles/2021-04-02/md5.js">3、sha1加密
据说这是最安全的加密
页面中引入sha1.js,调用方法为
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>sha1加密</title> <script type="text/ecmascript" src="/UploadFiles/2021-04-02/sha1.js">文章所包含的加密下载地址:
文中所含的js文件打包下载地址
下面给大家补充点知识:非常流行的javascript的md5加密
在网上看到的javascript的MD5加密,看比较好,就摘录了,供参考
<HTML> <HEAD> <META http-equiv='Content-Type' content='text/html; charset=gb'> <TITLE>非常流行的JS的md加密办法</TITLE> </HEAD> <BODY > <input id=test value=webasp> <input type=button value=md onclick="alert(hex_md(test.value))"> <script> var hexcase = ; /* hex output format. - lowercase; - uppercase */ var bpad = ""; /* base- pad character. "=" for strict RFC compliance */ var chrsz = ; /* bits per input character. - ASCII; - Unicode */ /* * These are the functions you'll usually want to call * They take string arguments and return either hex or base- encoded strings */ function hex_md(s){ return binlhex(core_md(strbinl(s), s.length * chrsz));} function b_md(s){ return binlb(core_md(strbinl(s), s.length * chrsz));} function hex_hmac_md(key, data) { return binlhex(core_hmac_md(key, data)); } function b_hmac_md(key, data) { return binlb(core_hmac_md(key, data)); } /* Backwards compatibility - same as hex_md() */ function calcMD(s){ return binlhex(core_md(strbinl(s), s.length * chrsz));} /* * Perform a simple self-test to see if the VM is working */ function md_vm_test() { return hex_md("abc") == "cdfbdfdef"; } /* * Calculate the MD of an array of little-endian words, and a bit length */ function core_md(x, len) { /* append padding */ x[len ] |= x << ((len) % ); x[(((len + ) > ) << ) + ] = len; var a = ; var b = -; var c = -; var d = ; for(var i = ; i < x.length; i += ) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md_ff(a, b, c, d, x[i+ ], , -); d = md_ff(d, a, b, c, x[i+ ], , -); c = md_ff(c, d, a, b, x[i+ ], , ); b = md_ff(b, c, d, a, x[i+ ], , -); a = md_ff(a, b, c, d, x[i+ ], , -); d = md_ff(d, a, b, c, x[i+ ], , ); c = md_ff(c, d, a, b, x[i+ ], , -); b = md_ff(b, c, d, a, x[i+ ], , -); a = md_ff(a, b, c, d, x[i+ ], , ); d = md_ff(d, a, b, c, x[i+ ], , -); c = md_ff(c, d, a, b, x[i+], , -); b = md_ff(b, c, d, a, x[i+], , -); a = md_ff(a, b, c, d, x[i+], , ); d = md_ff(d, a, b, c, x[i+], , -); c = md_ff(c, d, a, b, x[i+], , -); b = md_ff(b, c, d, a, x[i+], , ); a = md_gg(a, b, c, d, x[i+ ], , -); d = md_gg(d, a, b, c, x[i+ ], , -); c = md_gg(c, d, a, b, x[i+], , ); b = md_gg(b, c, d, a, x[i+ ], , -); a = md_gg(a, b, c, d, x[i+ ], , -); d = md_gg(d, a, b, c, x[i+], , ); c = md_gg(c, d, a, b, x[i+], , -); b = md_gg(b, c, d, a, x[i+ ], , -); a = md_gg(a, b, c, d, x[i+ ], , ); d = md_gg(d, a, b, c, x[i+], , -); c = md_gg(c, d, a, b, x[i+ ], , -); b = md_gg(b, c, d, a, x[i+ ], , ); a = md_gg(a, b, c, d, x[i+], , -); d = md_gg(d, a, b, c, x[i+ ], , -); c = md_gg(c, d, a, b, x[i+ ], , ); b = md_gg(b, c, d, a, x[i+], , -); a = md_hh(a, b, c, d, x[i+ ], , -); d = md_hh(d, a, b, c, x[i+ ], , -); c = md_hh(c, d, a, b, x[i+], , ); b = md_hh(b, c, d, a, x[i+], , -); a = md_hh(a, b, c, d, x[i+ ], , -); d = md_hh(d, a, b, c, x[i+ ], , ); c = md_hh(c, d, a, b, x[i+ ], , -); b = md_hh(b, c, d, a, x[i+], , -); a = md_hh(a, b, c, d, x[i+], , ); d = md_hh(d, a, b, c, x[i+ ], , -); c = md_hh(c, d, a, b, x[i+ ], , -); b = md_hh(b, c, d, a, x[i+ ], , ); a = md_hh(a, b, c, d, x[i+ ], , -); d = md_hh(d, a, b, c, x[i+], , -); c = md_hh(c, d, a, b, x[i+], , ); b = md_hh(b, c, d, a, x[i+ ], , -); a = md_ii(a, b, c, d, x[i+ ], , -); d = md_ii(d, a, b, c, x[i+ ], , ); c = md_ii(c, d, a, b, x[i+], , -); b = md_ii(b, c, d, a, x[i+ ], , -); a = md_ii(a, b, c, d, x[i+], , ); d = md_ii(d, a, b, c, x[i+ ], , -); c = md_ii(c, d, a, b, x[i+], , -); b = md_ii(b, c, d, a, x[i+ ], , -); a = md_ii(a, b, c, d, x[i+ ], , ); d = md_ii(d, a, b, c, x[i+], , -); c = md_ii(c, d, a, b, x[i+ ], , -); b = md_ii(b, c, d, a, x[i+], , ); a = md_ii(a, b, c, d, x[i+ ], , -); d = md_ii(d, a, b, c, x[i+], , -); c = md_ii(c, d, a, b, x[i+ ], , ); b = md_ii(b, c, d, a, x[i+ ], , -); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } /* * These functions implement the four basic operations the algorithm uses. */ function md_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } function md_ff(a, b, c, d, x, s, t) { return md_cmn((b & c) | ((~b) & d), a, b, x, s, t); } function md_gg(a, b, c, d, x, s, t) { return md_cmn((b & d) | (c & (~d)), a, b, x, s, t); } function md_hh(a, b, c, d, x, s, t) { return md_cmn(b ^ c ^ d, a, b, x, s, t); } function md_ii(a, b, c, d, x, s, t) { return md_cmn(c ^ (b | (~d)), a, b, x, s, t); } /* * Calculate the HMAC-MD, of a key and some data */ function core_hmac_md(key, data) { var bkey = strbinl(key); if(bkey.length > ) bkey = core_md(bkey, key.length * chrsz); var ipad = Array(), opad = Array(); for(var i = ; i < ; i++) { ipad[i] = bkey[i] ^ x; opad[i] = bkey[i] ^ xCCCC; } var hash = core_md(ipad.concat(strbinl(data)), + data.length * chrsz); return core_md(opad.concat(hash), + ); } /* * Add integers, wrapping at ^. This uses -bit operations internally * to work around bugs in some JS interpreters. */ function safe_add(x, y) { var lsw = (x & xFFFF) + (y & xFFFF); var msw = (x ) + (y ) + (lsw ); return (msw << ) | (lsw & xFFFF); } /* * Bitwise rotate a -bit number to the left. */ function bit_rol(num, cnt) { return (num << cnt) | (num > ( - cnt)); } /* * Convert a string to an array of little-endian words * If chrsz is ASCII, characters > have their hi-byte silently ignored. */ function strbinl(str) { var bin = Array(); var mask = ( << chrsz) - ; for(var i = ; i < str.length * chrsz; i += chrsz) bin[i] |= (str.charCodeAt(i / chrsz) & mask) << (i%); return bin; } /* * Convert an array of little-endian words to a hex string. */ function binlhex(binarray) { var hex_tab = hexcase "ABCDEF" : "abcdef"; var str = ""; for(var i = ; i < binarray.length * ; i++) { str += hex_tab.charAt((binarray[i] ((i%)*+)) & xF) + hex_tab.charAt((binarray[i] ((i%)* )) & xF); } return str; } /* * Convert an array of little-endian words to a base- string */ function binlb(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; var str = ""; for(var i = ; i < binarray.length * ; i += ) { var triplet = (((binarray[i ] * ( i %)) & xFF) << ) | (((binarray[i+ ] * ((i+)%)) & xFF) << ) | ((binarray[i+ ] * ((i+)%)) & xFF); for(var j = ; j < ; j++) { if(i * + j * > binarray.length * ) str += bpad; else str += tab.charAt((triplet *(-j)) & xF); } } return str; } </script> </BODY></HTML>以上所述是小编给大家介绍的javascript实现base64 md5 sha1 密码加密,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“javascript实现base64 md5 sha1 密码加密”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新动态
2024年11月09日
2024年11月09日
- 雨林唱片《赏》新曲+精选集SACD版[ISO][2.3G]
- 罗大佑与OK男女合唱团.1995-再会吧!素兰【音乐工厂】【WAV+CUE】
- 草蜢.1993-宝贝对不起(国)【宝丽金】【WAV+CUE】
- 杨培安.2009-抒·情(EP)【擎天娱乐】【WAV+CUE】
- 周慧敏《EndlessDream》[WAV+CUE]
- 彭芳《纯色角3》2007[WAV+CUE]
- 江志丰2008-今生为你[豪记][WAV+CUE]
- 罗大佑1994《恋曲2000》音乐工厂[WAV+CUE][1G]
- 群星《一首歌一个故事》赵英俊某些作品重唱企划[FLAC分轨][1G]
- 群星《网易云英文歌曲播放量TOP100》[MP3][1G]
- 方大同.2024-梦想家TheDreamer【赋音乐】【FLAC分轨】
- 李慧珍.2007-爱死了【华谊兄弟】【WAV+CUE】
- 王大文.2019-国际太空站【环球】【FLAC分轨】
- 群星《2022超好听的十倍音质网络歌曲(163)》U盘音乐[WAV分轨][1.1G]
- 童丽《啼笑姻缘》头版限量编号24K金碟[低速原抓WAV+CUE][1.1G]