version 1.0.0, 2013-10-24 : Initial version
Encoding and decoding using ROT13 cipher in perl
ROT13 is an example of the Caesar cipher. It is indeed a simple substution of the letters by the letter 13 letters after in the alphaber. This is what this regexp in this one-liner do here!For more informations about ROT13, consult its dedicated Wikipedia page!
1. Encoding
This simple perl regexp encodes an input string or file following the ROT13 rules.
perl -pe 'tr/N-ZA-Mn-za-m/A-Za-z/'
2. Decoding
And this one decodes an input string or file following the ROT13 rules.
perl -pe 'tr/A-Za-z/N-ZA-Mn-za-m/'