I was reading through the docs for vim, and noticed there's a shortcut, for example g?w would transform the next word using ROT13. I also know that you can change the encoding of a Python file to ROT13.

Here's my question: Why? It seems like it wouldn't be that useful, aside from prank programs like Django FUNserver.

3 Answers
3

There is history there. In the old days, long before the spoiler tag, you'd ROT13 a spoiler, or a joke punchline, or a riddle, so that it wouldn't be immediately readable, but it could still be quickly converted to readable format (if you ROT13 a piece of text a second time, it'll switch it back to the original text because there are only 13 26 (need more COFFEE) characters in the roman alphabet.)

So a lot of things that did mild obfuscation used ROT13, because it was commonly available, and so it's been backported into a number of more modern languages. It's just a weird quirk.

"...there are only 13 characters in the roman alphabet." I think you mean 26 characters.
–
GreenMattJul 28 '11 at 14:29

1

Also, I never did study Latin, but it uses quite a few more letter variants than does English. It's probably pretty safe to say that there are only 26 letters in the English alphabet, though.
–
Michael KjörlingJul 28 '11 at 14:44

ROT13 was originally devised to be used with Usenet postings that contained offensive material so the more sensitive among us wouldn't be inadvertently exposed to them. The idea was that you had to take an action to decode the posting as a way of indicating that you understood that you might find the contents offensive.

It's just a substitution cipher and isn't intended to provide any kind of privacy or authentication.

(ETA: It was very difficult to resist the urge to post this answer ROT13'd.)

"originally devised to be used with Usenet postings" Caesar posted on Usenet?(؟)
–
StuperUserJul 28 '11 at 14:39

2

@StuperUser: ROT13 is a subset of the Caesar cipher in that it (intentionally) only allows for one offset. And if Al Gore could invent the Internet, there's not reason Caesar couldn't have invented Usenet.
–
BlrflJul 28 '11 at 14:57

It was actually once used seriously as part of a 4 stage encryption process by Netscape Navigator to store email passwords. It is probably not their greatest idea and forms part of a case study of poor encryption (There may be a better version of this doc to link to somewhere - if so - please edit)