##Authored by Troy Osborne (Pseudomander) 4:45am 25/02/2012 AEST +10 ## ##Free to redistribute, use, copy, upload & adapt this work, all I ask is if it in anyway represents the original version please give credit where due## use warnings; $key=""; $offsetpattern=""; $offsetpattern2=""; while (length($key) < 4) { print "Please Enter Your Desired Key (5 or more characters) \n --> :"; chomp($key=<>); } @karray= split(//,$key); for ($i=0;$i :"; $inp=<>; if (($inp=~/E/) or ($inp=~/e/)) #Encryption { print "Enter Plaintext\n --> :"; chomp($plaintext = <>); $len = length($plaintext)-1; @array = split(//, $plaintext); for ($i=0;$i<$len;$i++) { $char = chr((ord($array[$i]) - ord($offset[$i % length($key)*length($key)])+ ord($offset2[$i % length($key)]))%256); print chr(ord($char)-($i%6)); } } elsif (($inp=~/D/) or ($inp=~/d/)) #Decryption { print "Enter Cyphertext\n --> :"; chomp($cyphertext = <>); $len = length($cyphertext)-1; @array = split(//, $cyphertext); for ($i=0;$i<$len;$i++) { $char = chr((ord($array[$i]) + ord($offset[$i % length($key)*length($key)]) - ord($offset2[$i % length($key)]))%256); print chr(ord($char)+($i%6)); } } <>;