Rot13: Difference between revisions

From Hackepedia
Jump to navigationJump to search
No edit summary
Roy (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


So you see A becomes N and N becomes A. This encryption can be found in many places online, such as Usenet and geocaching.com.
So you see A becomes N and N becomes A. This encryption can be found in many places online, such as Usenet and geocaching.com.
"But wait!", you say.  "My system, has no 'rot13' program!"  Fear not.  It is but one line of Perl:
#!/usr/bin/perl -p
y/A-Za-z/N-ZA-Mn-za-m/;
(OK, two lines, if you count the shellexec header).  rot13 is also found in the BSD games package.

Latest revision as of 20:13, 9 October 2005

Rot13 rotates all 26 letters of the alphabet by 13 positions rolling over to position 1 after position 26. A sample display of how rot13 "encrypts" is shown below:

$ echo A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | rot13
       N O P Q R S T U V W X Y Z A B C D E F G H I J K L M

So you see A becomes N and N becomes A. This encryption can be found in many places online, such as Usenet and geocaching.com.

"But wait!", you say. "My system, has no 'rot13' program!" Fear not. It is but one line of Perl:

#!/usr/bin/perl -p
y/A-Za-z/N-ZA-Mn-za-m/;

(OK, two lines, if you count the shellexec header). rot13 is also found in the BSD games package.