This is not a very interesting form of obfuscation, replacing each primitive of a straightforward program by some very convoluted code that evaluates to that primitive. Resulting in a huge program doing a simple thing. This kind of obfuscation can be easily automated, but so can the corresponding unobfuscation.
A more impressive form of obfuscation can be seen in the International Obfuscated C Code contest, where the straightforward program is replaced by a much shorter one that performs many ingenious tricks to achieve the same goal with a minimum of code. For example, a prime number sieve written as
Yes, but automatic obfuscation can be interesting, if not only simple substitution methods presented here.
E.g. something like [1] (Devirtualizing Nike.com's Bot Protection) discussed here [2].
Or something like this [3] (Analysis of Obfuscation Techniques Found in Apple FairPlay)
Somewhat tangential, pakettic[0] is a minifier for TIC-80 cartridges (a fantasy console) that use genetic algorithms to minimise and rearrange the Lua code to compress better in sizecoded demoscene competitions.
The Roblox community seems to be somewhat obsessed with obfuscation and of course deobfuscation. Literal script kids passing around blackbox software to hack each other and trying to hide their precious scripts. Unfortunately, that means the Lua communities constantly get bombarded by [de]obfuscation requests. It's almost always some kind of hacking/mischief.
12 comments
[ 2.1 ms ] story [ 40.3 ms ] threadA more impressive form of obfuscation can be seen in the International Obfuscated C Code contest, where the straightforward program is replaced by a much shorter one that performs many ingenious tricks to achieve the same goal with a minimum of code. For example, a prime number sieve written as
which is a Python rendition of the lambda calculus expression λ (λ 1 (1 ((λ 1 1) (λ λ λ 1 (λ λ 1) ((λ 4 4 1 ((λ 1 1) (λ 2 (1 1)))) (λ λ λ λ 1 3 (2 (6 4))))) (λ λ λ 4 (1 3))))) (λ λ 1 (λ λ 2) 2).That kind of obfuscation takes great human effort both to achieve and to unravel.
[1] https://en.wikipedia.org/wiki/Obfuscation_(software)
E.g. something like [1] (Devirtualizing Nike.com's Bot Protection) discussed here [2]. Or something like this [3] (Analysis of Obfuscation Techniques Found in Apple FairPlay)
[1] https://www.nullpt.rs/devirtualizing-nike-vm-1
[2] https://news.ycombinator.com/item?id=34285747
[3] https://news.ycombinator.com/item?id=37307653
[0] https://github.com/vsariola/pakettic
Sometimes you just don't want someone to be able to easily iterate on your script (grab a script, modify and resell)
There is zero reason for the embedded conditionals.