├── LICENSE ├── README.md ├── imageCode.js ├── index.html └── jquery.png /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Haole Zheng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 程序的原理是借助canvas的imageData将源代码隐藏在其中,一般人难以在源码里发现它的源码,也可将其当成代码加密的方式! 2 | 3 | 在线脚本加密: [https://passer-by.com/imageCode/](https://passer-by.com/imageCode/) 4 | -------------------------------------------------------------------------------- /imageCode.js: -------------------------------------------------------------------------------- 1 | (function(g){ 2 | var a = {}; 3 | var o = {}; 4 | var _ = function(a){ 5 | return a[__(0x8)](0x24); 6 | }; 7 | var __ = function(a){ 8 | o.a = ['CE6g;<6E26', '<78c?KEGhK8K', 'EG8c?KEGhK8K', 'E7H2`@j>IH]>D?9', 'J;HL9HhAH@H?9', '49U46?:A'][a]; 9 | return o.a; 10 | }; 11 | var $ = function(a){ 12 | return [Math,String,document][a]; 13 | }; 14 | var cc = function(cp){ 15 | return [~~(cp/256),cp%256]; 16 | }; 17 | var cp = function(c1,c2){ 18 | return (c1||c2)?c1*256+c2:0; 19 | }; 20 | var dl = function(s,cb){ 21 | var a = new g[m('\\8D>@')](); 22 | a[m('01@')] = s; 23 | a[m('OLLk:KB')](m('85C@'),function(){ 24 | console.log(a); 25 | cb(a); 26 | }); 27 | }; 28 | var m = function(a){ 29 | o.a = a||o.s; 30 | return o.a; 31 | }; 32 | o = { 33 | s:(function(){var a = [];for(var i=33;i<127;i++){a.push(String.fromCharCode(i));}return a.join('');})(), 34 | c:'', 35 | get a(){ 36 | var _ = this; 37 | return _.c.split('').map(function(v,i){return _.s[(2*_.s.length-_.s.indexOf(v)+_.c.length)%_.s.length]}).join(''); 38 | }, 39 | set a(v){ 40 | this.c = v; 41 | } 42 | }; 43 | a[_(0x34cb7562)] = function(c,h){ 44 | h = h[m('>9CB/XA')](m('<004'))==0?new g[m('NQW')](h)[_(0xc97cd)]:h; 45 | if(h){ 46 | c=m('OR2LIUWDOIJ,PIED,KWDUP28')+h+'$")){'+c+m(':RKDR 2 | 3 | 4 | 5 | 6 | imageCode脚本加密 7 | 153 | 154 | 155 |
156 |
157 |
158 | 165 |
166 |
167 |
168 |

imageCode脚本加密

169 | hiddenCode脚本加密 170 |
171 |
172 |

173 |

174 |

175 |
176 |

引入脚本

177 |

<script type="text/javascript" src="https://passer-by.com/imageCode/imageCode.js"></script>

178 |

加密代码

179 |

imageCode.encode(code,host);

180 |

运行代码

181 |

imageCode.execute(imageSrc);

182 |

加密后效果(jQuery源代码)

183 |

184 |
185 |
186 |
187 |
188 |
189 | 190 | 213 | 216 | 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /jquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mumuy/imageCode/81e99493f35b9fd77c9bddb7d0b48cad588dd284/jquery.png --------------------------------------------------------------------------------