MichaelXF / js-confuser

JS-Confuser is a JavaScript obfuscation tool to make your programs *impossible* to read.
https://js-confuser.com
MIT License
168 stars 28 forks source link

RegExp obfuscation #115

Open Le0Developer opened 7 months ago

Le0Developer commented 7 months ago

Is your feature request related to a problem? Please describe.

Currently regexes are passed through unmodified.

Describe the solution you'd like

Regexes like /ID\d{6}/g should use some of the following obfuscation techniques:

No idea for useful static string transformations (like the ID part) yet.

Describe alternatives you've considered

Manually replacing usages of /.../ with new RegExp("...") to enjoy string concealment, however the latter is far more verbose.

Additional context

See also https://docs.jscrambler.com/code-integrity/documentation/transformations/regex-obfuscation

MichaelXF commented 7 months ago

I think the converting regex literals to new RegExp is the best. Maybe in the future the extra obfuscations could be added