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.

  • + Because until this moment, I had forgotten what great fun we used to have with ROT13 and "non-geeks"... sigh. – Martin S. Stoller Jul 28 '11 at 14:56
up vote 18 down vote accepted

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.

  • 6
    "...there are only 13 characters in the roman alphabet." I think you mean 26 characters. – GreenMatt Jul 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. – a CVn Jul 28 '11 at 14:44
  • 1
    @green Ell. Oh. Ell. 13 is ROTing my brain. – Satanicpuppy Jul 28 '11 at 14:48
  • 1
    @Satanicpuppy: You mean YBY, surely! – TMN Jul 28 '11 at 15:04
  • 1
    @Michael: the Latin alphabet lacks a few of the characters in the English alphabet: it has 21 letters. In fact English used to have a few more letters, too. – user4051 Jul 28 '11 at 15:08

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.)

  • 9
    Instead you posted it in ROT26 - sneaky! – Roger Attrill Jul 28 '11 at 14:09
  • 4
    ROT26, nothing. For extra security, I used quadruple ROT13. – Blrfl Jul 28 '11 at 14:21
  • 2
    "originally devised to be used with Usenet postings" Caesar posted on Usenet?(؟) – StuperUser Jul 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. – Blrfl Jul 28 '11 at 14:57
  • 2
    @Blrfl: Caesar used ROT3. en.wikipedia.org/wiki/Caesar_cipher – user4051 Jul 28 '11 at 15:10

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)

  • cd to the directory, containing sqlite3, ~/.mozilla/firefox/vzfbtbbq.default or similar, and: sqlite3 urlclassifier2.sqlite 'SELECT * FROM goog_black_url' | tr "[A-Z][a-z]" "[N-ZA-M][n-za-m]" – user unknown Jul 28 '11 at 17:17
  • Sorry, of course not to the directory, containing sqlite3, but to the one, containing the firefox-Cache and so on. – user unknown Jul 29 '11 at 0:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.