I assume this has been done before, but since the Burrows-Wheeler transform seemed like such a cool way to obfuscate text, I decided to write my own japh with it.

my$l='}(yr=etd4d)c305123826312366135714622,,,,,,,,,,,811=1,1,-(,--,,,, +17-,81111-08,6-0-7,-,-,,--)0dc+t(y$$(@@@liswchhri;>!<i{hp=nf;mm))'; $l =~ s/>!</\0/;my@i=split//,$l;my@t=sort@i; for(1..@i-1){my($i,$j)=0;for$j(@t){$j=$i[$i++].$j;}@t=sort@t;} my($a)=@t;$a=~s/\0//;eval$a;

This just takes a string that has been encoded with the BWT, decodes it, and passes it to eval. The string itself is a minimally obfucated perl program to display a string encoded as a list of numbers

Here is the short program I wrote to compute the BWT

my$in="$ARGV[0]\0"; sub n{substr($_[0],1).substr($_[0],0,1)} my($r, @r)=(n($in),$in); while(${r}ne$r[0]){push@r,$r;$r = n($r);} @r=sort@r;my$l=join'',map{substr($_,-1,1)}@r;

The null character is used as an end of line indicator, just so the sorting is easier. In the first program, the null is replaced with ">!<" for storage.


In reply to JABWT by ailivac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.