1

前端代码加密,存在图片里

 2 years ago
source link: https://www.v2ex.com/t/812796
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

前端代码加密,存在图片里

  mumuy · mumuy · 1 天前 · 2119 次点击

开发前端的可能会碰到这样的问题,辛辛苦苦开发的功能,一发布就被别人把代码拷走了。网上常见的方法一般是压缩、混淆等等,加密后的代码通常包含 eval ,替换成 console.log 很容易就被破解。可以说前端没有秘密,再多的加密方式就是让对方多折腾而已……

于是,我也想尝试让别人折腾一下,不愿意轻易交出源代码。将源代码混进图片里面也是一种尝试,你可以在存入时限制脚本运行的域,如果域不符合,就自动跳转掉。这样可以保证对方在没有破解你代码的情况下,直接拷走你的脚本也是无法正常运行的。然后再对加载脚本进行人工的多层加密,让对方难以简单地通过破解加载脚本而破解源代码。

项目地址: https://github.com/mumuy/imageCode

演示地址: https://passer-by.com/imageCode/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK