Type or paste some text in either of the text areas, and its rot13 will appear in the other one.
What's rot-13 for? Suppose you want to write something (the answer to a clue, say) so that the reader can avoid accidentally reading it, but it's simple for the reader to read it when he wants to. The canonical way to do this is to encode it in rot-13. In rot-13, each letter in the first half of the alphabet is replaced by the one 13 places later (e.g. a by n), and each letter in the second half of the alphabet is replaced by the one 13 places earlier (e.g. n by a).
If you want to disguise something for this purpose, please use rot-13. Its advantages are that it's simple, that encoding and decoding are the same operation, it's what readers expect, and it's what programmers like me provide.
If you use Microsoft Developer Studio to maintain text files, you can rot-13 at the press of a key. From the Tools menu, select Macro. In the Macro form, either choose a macro file if any are offered, or click on Options, then New File, then fill in and OK the New Macro File form. In the Macro form, click Edit. Fill in and OK the Add Macro form. Replace the Sub to End Sub lines, inclusive, with the code between the horizontal lines below:
Sub rot13 ()
'DESCRIPTION: Rot-13 the active document's selected region in situ.
'The region is unselected, with the cursor at the right-hand end
'Copyright © Richard Sabey 2003. All rights reserved.
' r builds the rot-13'd string. Then, at the end, this rot-13'd
' string replaces the active document's selected region in situ
Dim r, i, c, rc, l
r = ""
l = Len(ActiveDocument.Selection)
For i = 1 To l ' sic; VB string indices are 1 too high
' For each char c in the active document's selected region
c = Mid(ActiveDocument.Selection, i, 1)
if c>="a" And c<="m" Or c>="A" And c<="M" Then
rc = Chr(Asc(c)+13) ' a...m become n...z
ElseIf c>="n" And c<="z" Or c>="N" And c<="Z" Then
rc = Chr(Asc(c)-13) ' n...z become a...m
Else
rc = c ' rot13 leaves non-letters unchanged
End If
r = r + rc ' append this char to the rot-13'd string
Next
ActiveDocument.Selection = r ' voila!
End Sub
From the Tools menu, select Customise, then the Keyboard tab. In Category, select Macros. In Commands, select rot13, the name of the command. Put focus in the Press new shortcut key box, do that, then click Assign. From now on, pressing that key will rot-13 the selected region.