I consider this brittle because:

  1. It has to be in a file to work.
  2. In its file, it has to be one long line, and it has to be the first line.
  3. It relies on a particular implementation of crypt.
$gkh=open+0;$_=$WptYp=<0>;while(s*(..)(.{8})**){$keG.=crypt$2,$1}$WptYp^=$keG;$WptYp=~y%\040-\x7f%%cd;print$WptYp=~m~(J.{3})~,"\n"

I didn't do much to obscure what this code does, but here's a short description:

After I started this, I wondered if there was something similar already here, and I found liverpole's signature. I'd be interested in other instances.

Replies are listed 'Best First'.
Re: Brute force JAPH
by liverpole (Monsignor) on Feb 05, 2007 at 14:49 UTC
    Hi kyle,

    I wrote an obfuscation that does something similar.  It was actually the inspiration that made me base my signature on the same idea.

    It's a good (and, I believe, seldom-used) mechanism for obfuscations, partly because you can't know what the output will be until you run it.  perl -MO=Deparse program.pl doesn't help a bit!

    Update  You could also simply do ...

    ... or something equally simple :)


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

      you can't know what the output will be until you run it.

      Yes! That's a better way of saying what I like about it.

      You could also simply do ...

      Yes, that's a lot simpler, and it obviously requires the same brute force approach to produce. Still, I really like the idea of having it use itself to produce its output, but I'm not sure why. If I weren't shooting for that specifically, generation would have been easier. An early version did not vary the delimiters, but there was too much static text producing the same results from iteration to iteration.