This doesn't look very daunting. Let's replace constants:$a = ord $/; $b = $a - 9; for( 483315457, 3759149058, 3883269635, 3794874370, 1647390720, 1644171264, 1912787457, 4277106435, 4100403459, 608567554, 608436482 ) { $c = 0; for( split//, substr unpack("B*", pack"L*", $_), 6 ) { $o[$c] += (ord d, ord 2, $a, $a, $a, $a, $a/2, $b, $b, $b, $b) +[$i] if $_; $c++; } $i++; } print chr for @o;
Now it's pretty clear why it's titled "roman obfu". It's also obvious that $c selects one roman numeral from the list for each iteration of the outer loop. The inner loop iterates over @o and increments the current position by the value of the current roman digit if it has its bit set. Putting that in its own sub, we get the rather readablefor( '01110011111100111000011100', '10000100000001000011100000', '11111111100111010111100111', '10001100000011000111100010', '00001100000011000101100010', '00000100000000000001100010', '01110100100000001001110010', '11011101111110111111111110', '11001100010110011111110100', '10000000010100011000100100', '10000000010100010000100100', ) { $c = 0; for( split//, $_ ) { $o[$c] += (100, 50, 10, 10, 10, 10, 5, 1, 1, 1, 1)[$i] if $_; $c++; } $i++; } print chr for @o;
In other words, the ASCII value for each character in Just another Perl hacker is expressed as a roman numeral.sub increment_pos { my ($bitstring, $inc) = @_; my @bits = split //, $bitstring; for my $i (0 .. $#bitstring) { $o[$i] += $inc if $bitstring[$i]; } } increment_pos('01110011111100111000011100' => 100); increment_pos('10000100000001000011100000' => 50); increment_pos('11111111100111010111100111' => 10); increment_pos('10001100000011000111100010' => 10); increment_pos('00001100000011000101100010' => 10); increment_pos('00000100000000000001100010' => 10); increment_pos('01110100100000001001110010' => 5); increment_pos('11011101111110111111111110' => 1); increment_pos('11001100010110011111110100' => 1); increment_pos('10000000010100011000100100' => 1); increment_pos('10000000010100010000100100' => 1); print chr for @o;
Makeshifts last the longest.
In reply to Re: Roman Obfu (spoiler: unraveled)
by Aristotle
in thread Roman Obfu
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |