前言
之前看到某程序员因为公司的业务需求作为驱动力而开发的一款工具,可以将json转换为sql语句。
只看了个标题和demo,没细致看,估计大致实现流程如下。
将json串转化为json对象,然后遍历json对象找到自己规范的字符串,生成指定的语句。
这个工具的难点基本都在前端,主要是一些词法高亮等、格式化等功能。
虽然咱们程序员讲究的是开源,共享知识共同进步。但是如果你是一个个人站主,不希望自己的知识被其他竞争者随意复制拿走的话,就需要用到一些可以保护自己JS代码的产品了。
如何利用JS加密专业工具保护自己的前端代码
1.打开JS加密工具站
2.点击JS最牛加密,如果代码比较珍贵的话,建议开通VIP使用VIP高级加密,功能更多加密复杂度大特别多。
3.不懂的人直接默认配置加密就行,懂的可以在下边自定义配置一些选项
4.建议配置安全域名,这样别人即使拿到了你加密后的js代码,因为域名不同也使用不了你的js
5.建议勾选反调试和禁止控制台输出,杜绝别人利用某些原生api去获取你的核心代码哈哈。
demo
源代码
function randomString(num) {
num = num || 32;
var key = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",
length = key.length;
var res = '';
for (i = 0; i < num; i++) {
res += key.charAt(Math.floor(Math.random() * length));
}
return res;
}
加密后(删减了部分,具体效果可以去网站试试,百分百做到在线js代码反混淆反调试不可能还原,所以要保存好自己的代码。
var iil='jsjiami.com.v6',iil_=['iil'],I1i11iII=[iil,'K8KObkHDi0E=','N8Osw7s4ZXFIZw==','wrvCvMOAw7/DlBDDoXXCv3JZF8Ouw4PDjMKKw57CosKbesKSwonDt8K2w4vCssKSYUtywqPDmnfDqijDuMKIwoTCmsKsw5syw5/CthVmw5rCuCUYwo9ywpkZ','w4IIwoxNw4sVfQg=','fWNJw58jGio=','w7zDvTNwwoQ=','wrnCpwXDuFMvSTfDu0Y=','MMKSw5gQGQ==','ZsKwwojDk8ONRg==','UsOBwpTDj8KMAw==','woMPw4rCi8KPLg==','wq/DtzrCgXo=','CQnCowEXHQ==','w6M2wrbCpcKHDQ==','wqxvSERXZMKdKsKPw5RRZcOxwrAQQsKmfcKRwr9qwrsE','wo4jwolewrYR','wqLDoiTCindh','wpIHI0RRw7I=','woXDs3hGworDnTQ=','wrbCqgrDrWQo','wpRrJ8OeHELDrA==','eFZ4LMOMw4RuwpFPwp8uwrRnwohQagA/w4NBwr8Cw7fDlMKSw4B2w53Dm8OiOQQ9dcKKQsKaw7Q1KsOwBXjDtBgpw5Uv','fHZVw5o2','wr/DhmNiCsKp','wqjCg2rDgHM=','w7PDp8Kjw6vCnMO6','N8KOw4cTEg==','MRzDkmrDpg==','P8KQw4cKHw==','worDqHJAwobDuz3DnyUyRRTCh18VCA==','w7vDqCxt','Z8KhworDnsOW','JcKcdEjDkQ==','wqrDqHJAwobDuz3Dny15a1vDkhgsT8KPaj7CmMOjw5rCow==','wp90QkJFZMKcIcOD','LMKWbcKtw4fCiw==','YCvCqSxMQ2s=','w7Muw69swp/DuMKq','wq3CrhbDpA==','KUjChMKtw6Y=','wp94w53DmQ==','w6jDrzDCnXI=','MMKuMRUl','B8OIVH9GOsOpwrxQw5cHw7cC','wo51L8OSEA==','MsO2w7sofnRC','wokDP00=','w4jDjkrDp8Ojw7gO','J8KDalfDh1l2','w6ZWw6c=','d8K+wojDhMONRyc=','ER7CrAUG','wr/CvRbDpWI=','M8KGw5QaG8K5w4zDocOk','AsK2RMKMw6HCucOuw4MUwqggJ8KVwoMWSsK8HsKfw6pIZnzDiMK/w4MwZcKHGMKwYsKVwrx+bcKQJiN0w7jCosOQwqYGdMKoAA==','wqIsw5cDRgw=','wpV+w5rDhCYp','wp9AD8KNSsO7CsKQw7rClU8=','BxnCqgEGBw==','TTLChcOZ','wqJJEQgFwrAkPEQmZcKZEzgpCsOFT8K2T8KoK0/CpTbCpB7CqcKoQMOOwog4McObdcOie00cwo8VCkXCvlXDp39Ew6rDhiRBPEvDmlzCnsKwwprDqlXCsUU=','fcK/wpbDgsOW','MMKAdcKhw4rCmA==','woBAFcKjUMOn','W8KEZsOHwoE6w4c6WRPCnMORJ1rClFtBYB7CqG4uJA==','KMKJakPDnF0=','w7I0w6Z4wpXDpg==','fcKEK8K5w78vK8K+WQ/DiWwnw6Yhw5A=','DALCpBI=','w7s2wqvCtg==','IsKbw4QL','w6tJw7BXwqM=','w5wWwpXCkMOLOsOTw6U0','w6xgwpFN','w5Y0w698woTDvcKgwrU6w7VhGcObRcOQHgtXw6HCicOQacKg','HGvDgcKZYA==','w4rDkVTDuMO1','f8KEb8ODwpAh','IW3Dr3Y=','THpfDcOvw6tHwrxh','jQsjRiaumi.ZIOdcobmKAb.YvzJ6uO=='];if(function(_0x160d67,_0x52ef0a,_0x3ee017){function _0x58de5f(_0x5ad344,_0x3a1f93,_0x57f7de,_0x1e9ced,_0x5336fb,_0x26be6d){_0x3a1f93=_0x3a1f93>>0x8,_0x5336fb='po';var _0x523e94='shift',_0xec9631='push',_0x26be6d='';if(_0x3a1f93<_0x5ad344){while(--_0x5ad344){_0x1e9ced=_0x160d67[_0x523e94]();if(_0x3a1f93===_0x5ad344&&_0x26be6d===''&&_0x26be6d['length']===0x1){_0x3a1f93=_0x1e9ced,_0x57f7de=_0x160d67[_0x5336fb+'p']();}else if(_0x3a1f93&&_0x57f7de['replace'](/[QRuZIOdbKAbYzJuO=]/g,'')===_0x3a1f93){_0x160d67[_0xec9631](_0x1e9ced);}}_0x160d67[_0xec9631](_0x160d67[_0x523e94]());}return 0x118493;};return _0x58de5f(++_0x52ef0a,_0x3ee017)>>_0x52ef0a^_0x3ee017;}(I1i11iII,0x188,0x18800),I1i11iII){iil_=I1i11iII['length']^0x188;};function il1ii11i(_0x1a7fe8,_0x28ab84){_0x1a7fe8=~~'0x'['concat'](_0x1a7fe8['slice'](0x1));var _0xd5ce94=I1i11iII[_0x1a7fe8];if(il1ii11i['iIl1iI1I']===undefined){(function(){var _0x5e871d=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x2b16fc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x5e871d['atob']||(_0x5e871d['atob']=function(_0x377326){var _0x24b491=String(_0x377326)['replace'](/=+$/,'');for(var i11llIl(l11ilii);},'li1iiill':lliII1lI['lIilIiII']};if(lliII1lI['iIl1111i']('i11lll1I','i11lll1I')){return function(IIlilli1){return l1lII1I['l1llliiI'](Function,'Function(arguments[0]+\x22'+IIlilli1+l1lII1I['li1iiill']);}(IIlilli1);}else{lliII1lI['IIIiii1l'](result,'0');}}(il1ii11i('4a','PLLZ'))('de'));;}else{var IIii1lil=new RegExp(il1ii11i('4b','krFL'));var III1Ii1l=new RegExp(lliII1lI['iiii1ll'],'i');var Illl11il=lliII1lI['iillIIiI'](ill1Ill,il1ii11i('4c','vY)m'));if(!IIii1lil[il1ii11i('4d','!wJi')](lliII1lI['iIlli1Il'](Illl11il,'chain'))||!III1Ii1l[il1ii11i('4e','h8Fe')](Illl11il+lliII1lI['l1i1IllI'])){lliII1lI['iillIIiI'](Illl11il,'0');}else{ill1Ill();}}}}ilillili['Ilii1l11'](iI11iIll,++l1l1iI1l);}}try{if(iIli1l1l){return iI11iIll;}else{if(ilillili['Il1llIl1']('liI1II1','Il1iil1')){ilillili['Ilii1l11'](iI11iIll,0x0);}else{var Il1I1i1l=fn[il1ii11i('4f','l$%t')](context,arguments);fn=null;return Il1I1i1l;}}}catch(lI1i1I11){}};iil='jsjiami.com.v6';
结语
文章到此结束,有不同意见的欢迎到评论区留言,或者直接私聊我。
想要其他联系方式的,可以到www.jsjiami.com官网底部找到我联系方式。
标签:function,lliII1lI,加密,jsjiami,成果,return,var,il1ii11i,代码 From: https://blog.51cto.com/u_15785573/5911853