我正在寻找使用JavaScript混淆器。什么是一些最受欢迎的产品,它们对性能有什么影响?什么是最好的JavaScript混淆器?
回答
雅虎有一个很不错的。它在技术上是一个缩小器,但它在这个过程中做了一个很好的混淆处理。
通过YUI Compressor免费在线压缩和混淆:http://refresh-sf.com/yui/ – NexusRex 2012-12-11 07:13:58
链接不再有效 – 2017-11-23 08:40:21
好吧,谷歌提出了这个作为第一个链接:
http://www.javascriptobfuscator.com
但我不知道的JavaScript良好的混淆一样。无论你在JavaScript中做什么需要混淆,都应该在服务器端完成,对吗?
在我看到的所有内容中,这可能是最好的混淆器。虽然我还没有试过JScrambler。 – AStackOverflowUser 2014-05-23 03:22:16
我从来没有在生产中使用混淆器,但我测试过JavaScript Utility,似乎很不错。
至于性能,混淆代码必须在每次加载页面时,在每次加载页面时动态解压缩。对于小脚本可能不是问题,但拆包时间对于更大的文件会很重要。另一方面,缩小的代码可以直接由浏览器执行。
某些混淆器可能会产生不能在较旧或较不常见的浏览器中运行的输出。您应该仔细测试您计划支持的浏览器。
混淆器不需要任何代码解包。其他用于最小化代码的方案可能需要这样做,但本身并没有产生障碍。 – 2009-09-07 09:28:45
你也可以试试Dean Edwards写的JavaScript Compressor。
测试8个不同的模糊处理(除www.javascriptobfuscator.com),并通过他们都多少吸惊讶。最终用正则表达式编写自己的混淆器。享受:
static Dictionary<string, string> names = new Dictionary<string, string>();
static bool testing = false;
static string[] files1 =
@"a.js,b.js,c.js"
.Split(new string[] { Environment.NewLine, " ", "\t", "," }, StringSplitOptions.RemoveEmptyEntries);
static string[] ignore_names =
@"sin,cos,order,min,max,join,round,pow,abs,PI,floor,random,index,http,
__defineGetter__,__defineSetter__,indexOf,isPrototypeOf,length,clone,toString,split,clear,erase
RECT,SIZE,Vect,VectInt,vectint,vect,int,double,canvasElement,text1,text2,text3,textSizeTester,target,Number
number,TimeStep,images,solid,white,default,cursive,fantasy,".
Split(new string[] { Environment.NewLine, " ", "\t", "," }, StringSplitOptions.RemoveEmptyEntries);
string[] extra_names = @"a,b,c".Split(new string[] { Environment.NewLine, " ", "\t", "," }, StringSplitOptions.RemoveEmptyEntries);
string src = @"C:\temp";
string dest1 = src + "\\all1.js";
string dest2 = src + "\\all2.js";
static void Main()
{
File.Delete(dest1);
File.Delete(dest2);
foreach (string s in files1)
File.AppendAllText(dest1, File.ReadAllText(src + "\\" + s) + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
string all = File.ReadAllText(dest1);
int free_index = 0;
foreach (string s in extra_names)
{
free_index++;
string free_name = "" + (char)('A' + (free_index % 25)) + (char)('A' + ((free_index/25) % 25));
Debug.Assert(free_name != "AA");
names.Add(s, free_name);
}
Regex reg1 = new Regex("(var |function |\\.prototype\\.)([a-zA-Z0-9_]+)");
int startat = 0;
while (startat < all.Length)
{
Match match = reg1.Match(all, startat);
if (!match.Success)
break;
string key = all.Substring(match.Groups[2].Index, match.Groups[2].Length);
if (!ignore_names.Contains(key))
{
free_index++;
string free_name = "" + (char)('A' + (free_index % 25)) + (char)('A' + ((free_index/25) % 25));
Debug.Assert(free_name != "AA");
if (!names.ContainsKey(key))
names.Add(key, testing ? key + free_name : free_name);
}
startat = match.Groups[0].Index + match.Groups[0].Length;
}
Regex reg2 = new Regex(@"/\*.*\*/", RegexOptions.Multiline);
Regex reg3 = new Regex("([^:\\\\])//.*\r\n");
Regex reg4 = new Regex("([a-zA-Z0-9_]+)");
Regex reg5 = new Regex("(\r\n)*[ \t]+");
Regex reg6 = new Regex("(\r\n)+");
all = reg2.Replace(all, eval2);
all = reg3.Replace(all, eval3);
all = reg4.Replace(all, eval4);
all = reg5.Replace(all, eval5);
all = reg6.Replace(all, eval6);
File.WriteAllText(dest2, all);
}
public static string eval4(Match match)
{
return names.ContainsKey(match.Groups[1].Value) ? names[match.Groups[1].Value] : match.Groups[0].Value;
}
public static string eval5(Match match)
{
return string.IsNullOrEmpty(match.Groups[1].Value) ? " " : Environment.NewLine;
}
public static string eval6(Match match)
{
return Environment.NewLine;
}
public static string eval2(Match match)
{
return " ";
}
public static string eval3(Match match)
{
return match.Groups[1].Value + Environment.NewLine;
}
帕克用base62
http://dean.edwards.name/packer/
https://github.com/jcoglan/packr < =红宝石版本
- 1. 什么是可用作Java库的最佳免费JavaScript混淆器?
- 2. 这是什么混淆JavaScript代码段意味着/做什么?
- 3. 什么是用来混淆这个Javascript或者我如何去混淆它?
- 4. 免费的JavaScript混淆器?
- 5. 混淆/缩小动态生成的javascript的最佳方式是什么
- 6. 为什么混淆JavaScript代码是一种糟糕的风格?
- 7. 说什么混淆环境和对象是Javascript的根本罪?
- 8. VisualStudio javascript混淆器窗口
- 9. JavaScript BlockStatement混淆
- 10. Javascript Promise.all混淆
- 11. 混淆在JavaScript
- 12. 如何最好地混淆HTML/Javascript/WebGL代码?
- 13. JavaScript的\” \” IM混淆
- 14. 的JavaScript混淆双
- 15. 什么是一些可靠的Flash混淆器?
- 16. 什么是最好的XML解析器
- 17. 什么是最好的PHP编辑器?
- 18. 哪个是最好的价格/质量关系的.net混淆器?
- 19. Javascript混淆算法
- 20. JavaScript与ID混淆
- 21. javascript和silverlight混淆!
- 22. 了解javascript混淆
- 23. 混淆JavaScript语句
- 24. 高级Javascript混淆
- 25. javascript功能混淆?
- 26. Javascript矩阵混淆
- 27. JavaScript参数混淆
- 28. Perl代码是否有很好的混淆器?
- 29. PHP混淆器?
- 30. 愤怒的小鸟使用什么javascript混淆?
虽然罗伯特·哈维提出的问题可能更多或更少的真实,这里的答案提供混淆器的列表,非常有用。此外,哈维先生暗示,这个专家网站只能回答简单的问题,专家的“意见”和扩大的讨论在某种程度上是否定的。如果问题是“我能得到一个混淆器列表吗?”这个问题是可以接受的吗?问候,Dave H. – DHorse 2013-07-15 02:24:35
** DUPLICATE的** - >>> ** http://stackoverflow.com/questions/194397/how-i-i-ob-fuscateprotect-javascript ** – 2014-06-12 10:05:55
你可以使用http:// jsobfuscator .byethost7.com/ – 2016-05-03 12:31:17