logoalt Hacker News

s-macketoday at 9:03 AM3 repliesview on HN

Yes, I’ve tried it. For example, this was my winning entry from a year ago [0]. The LLM only performs trivial obfuscation, not advanced transformations.

For example:

  if (x == 1 || x == 2) { ...
can be transformed into:

  if (!(2+x*x-3*x)) { ...
An LLM will do this if you explicitly ask it to, but not on its own.

[0] https://github.com/ioccc-src/winner/blob/master/2024/macke/p...


Replies

tromptoday at 9:17 AM

One of the main instruments of obfuscation (and the way to get more out of the size constraints) is making the code as short as possible, so in that example you'd prefer

    if (!(x/2-1)) { ...
EDIT: Oops, confused the original with x==2 || x==3. Instead, we can use !(x-1>>1), which precedence rules parse as !((x-1)>>1).
show 3 replies
fookertoday at 10:11 AM

Not sure what you mean by advanced transformations but I got these versions from ChatGPT without explicit instructions.

  if(x-1<2&&x)...
  if((1<<x)&6)...
  if(x<3&x)...
  if(3%x&&x<3)...
  if(!((x-1)*(x-2)))
  if(!(x^1|x^2))...
  if(!(x*x-3*x+2))
show 1 reply
nsoonhuitoday at 9:27 AM

But then we all know that LLM has come a long way since one year ago.

Are you sure they still can't do it?

show 1 reply