"be consistent" | |
PerlMonks |
Re: Dollar Plusby ambrus (Abbot) |
on Oct 01, 2010 at 17:51 UTC ( [id://862996]=note: print w/replies, xml ) | Need Help?? |
The story of this obfuscation is this. When martin posted the obfuscation ASCII arithmetic, I praised it in the chatterbox, but mentioned that it would be even more amazing if one could have a similar obfuscation that
worked over the GF(128) field.
martin replied with this obfu the day after, which indeed does what I asked for.
Again, the characters long string literal gives the coefficients of a polynomial. This time, however, the values are over GF(128), represented in the obvious way, with the bit i of the character adding g**i to the value where g is a generator of the field. The first map loop generates the first 257 powers of g, writing them to @+. Then this table is inverted to %+ which functions as a discrete logarithm table. This allows one to compute the product of two values $x, $y as simply $+[$+{$x}+$+{$y}] (except when one of the values is zero for which an extra test $;eq$/ is needed at one place). The polynomial is again evaluated at a points in a geometric series.
Of course, some obfuscations have multiple layers, so one can't easily be sure one does what it looks like. Thus, I verified that my thinking is right by trying to construct a new polynomial.
In Section
Obfuscated Code
|
|