Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

GotToBTru's scratchpad

by GotToBTru (Chaplain)
on Jun 15, 2010 at 13:25 UTC ( #844863=scratchpad: print w/ replies, xml ) Need Help??

use strict; use warnings; my $plaintext = 'We are discovered. Flee at once!'; my $key = 'CorrectBatteryHorseStaple'; print "Original message: $plaintext\n"; my $ciphertext = cypher($plaintext,$key); my $represent = $ciphertext; $represent =~ tr/[A-Za-z0-9] /*/c; print " Encoded message: $represent (* indicates non-alphabet characte +r)\n "; my $decoded = cypher($ciphertext,$key); print " Decoded message: $decoded\n"; sub cypher { my $plain = shift; my $key = shift; my $i=0; $key x= ( 1 + length($plain)/length($key) ); return join '', map {$_ ^ substr($key,$i++,1)} (split '',$plain); }
DatePointsPostsRankETA Next RankNext Rank
2010061500InitiateN/AN/A
201407211794154HermitN/AChaplain (1800)
201407231806154Chaplain20141030Deacon(2400)
201409102192185Chaplain20141006Deacon(2400)
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2014-09-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls