Obfuscating Lua (2019)
gist.github.com
gist.github.com
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
import sys
def c(j,t):
sys.stdout.write(j('.')('P'))
return t
(lambda z:lambda y:z(z(y(lambda p:lambda n:(lambda s:lambda z:z(lambda x:
lambda y:y)(lambda d:p(s)(y(s))(d)))(lambda x:lambda a:lambda s:lambda p:
p(a)(lambda y:s(n(x))(y))))(lambda c:lambda a:lambda s:z(lambda y:s(c)(y)
))))(y(lambda p:lambda b:lambda t:t(c(b,p)))))(lambda s:lambda p:p(lambda
x:lambda y:x)(s))(lambda f:(lambda q:q(q))(lambda x:f(lambda y:x(x)(y))))
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.
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
There is zero reason for the embedded conditionals.
Sometimes you just don't want someone to be able to easily iterate on your script (grab a script, modify and resell)