javascript-obfuscator icon indicating copy to clipboard operation
javascript-obfuscator copied to clipboard

[Idea] Single letter string literal obfuscation

Open da411d opened this issue 5 years ago • 2 comments

Sometimes code may contain one-char string literals. My idea to obfuscate it with String.fromCharCode

Example input:

const justRandomExample = "[" + someVariable + "]";

Output:

const justRandomExample = String.fromCharCode(91) + someVariable + String.fromCharCode(93);

It may be useful when the code generates some token or query params, with this feature it may be harder to notice the place in code. For example, in my project there is a key map for one of key features - fake events generator. When someone notice that it is that keymap - he will know that other events code is nearby. image

da411d avatar Aug 05 '20 11:08 da411d

Maybe you know better ways to mask string instead of String.fromCharCode. For 0-9a-z combinations may be useful number.toString from #681

da411d avatar Aug 05 '20 11:08 da411d

Like it. Will try in some future.

sanex3339 avatar Aug 05 '20 14:08 sanex3339