I consider this brittle because:
I didn't do much to obscure what this code does, but here's a short description:
Since crypt is a one-way function, there's no direct way to create a program like this that generates a particular text. To make this JAPH, I wrote a program that generated random instances of a format like the above and test whether they produced a match. The parts it varied were the variable names and the delimiters on m, s, and y. It found the above after 1.4 million tries. It found one (on my home node) to print "kyle" after 6.8 million tries.
I wanted to make one that would produce the whole phrase, "Just another Perl hacker", but it ran all weekend on eight computers and never found one. The pattern it was trying to match (reproduced below) was based on Leet to make it easier, but it still never got one.
sub wanted { my $space = qr/[_.`' \t]/; my $u = qr/[uv]/; my $s = qr/[s5z2\$]/; my $t = qr/[t7+]/; my $n = qr/[n^]/; my $o = qr/[o0p]/; my $h = qr/[h#]/; my $e = qr/[e3&]/; my $r = qr/[r2]/; my $p = qr/[p?9]/; my $l = qr/[l1|]/; my $c = qr/[c<({\[]/; return qr/j$u$s$t $space [a'4@^]$n$o$t$h$e$r $space $p$e$r$l $space $h[a4@^]($c[k]$e|x$o)$r/x; }
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 | |
by kyle (Abbot) on Feb 05, 2007 at 18:01 UTC |