13

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.

FrustratedWithFormsDesigner
  • 46,105
  • 7
  • 126
  • 176
Brian Hicks
  • 233
  • 2
  • 7

3 Answers3

19

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.

Satanicpuppy
  • 6,210
  • 24
  • 28
  • 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. – user 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. –  Jul 28 '11 at 15:08
  • @graham: Yea, I didn't want to go there. I thought about saying the "English" alphabet, which would make sense, but is kinda anglocentric. – Satanicpuppy Jul 28 '11 at 15:15
  • @Satanicpuppy: Not a biggee, just thought you'd like a chance to correct it ... and I can relate to the need for caffeine! – GreenMatt Jul 28 '11 at 15:16
  • Next time just say 'there are only 26 letter keys on QWERTY keyboard'. That should avoid all confusion. :P – Mchl Jul 28 '11 at 19:38
  • The usual Swedish keyboard layout is QWERTY (very few use anything else), and it has all 29 letters of the Swedish alphabet (A-Z plus Å, Ä, Ö), in addition to all the usual extra fluff such as digits, punctuation, control keys and so on. :) – user Jul 29 '11 at 06:41
  • Talking about the "English alphabet" might be somewhat anglocentric, but in this case, I think that is perfectly justified. – user Jul 29 '11 at 06:42
8

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

Blrfl
  • 20,235
  • 2
  • 49
  • 75
2

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)

Roger Attrill
  • 336
  • 2
  • 10
  • 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 00:52