Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

A slightly less simple obfuscation for a slightly less simple substitution cipher. The next stop in my tour of old forgotten encryption ciphers is this skytale implementation. This either takes a file as a parameter to encrypt in skytale, or provided no input encrypt's it's __DATA__.

#!/usr/bin/perl open DATA,$ARGV[0]if$ARGV[0];$;=$0=~y~a-z~~;map{m'(\d+)(?{$*=chr$,+65; +push@{$*}, $^N;$.{$*}++;$,=$,<$;?++$,:0})'}grep!/^10$/,map ord,split//,join'',<DA +TA>; print join '' , map chr , @ $_ for 'A' .. ( sort keys ( % . ) ) [ -1 ] ; pr +int "\n" ; __DATA__ In cryptography, a scytale (also known as skytale) is a tool used to p +erform a transposition cipher, consisting of a cylinder w/ a strip of paper wou +nd around it on which is written a message across the windings, with the ciphert +ext consisting of the unwound paper. This is one way to implement such a +cipher.

$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

In reply to Skytale cipher by chargrill

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (4)
    As of 2017-03-31 01:25 GMT
    Find Nodes?
      Voting Booth?
      Should Pluto Get Its Planethood Back?

      Results (364 votes). Check out past polls.