
ROT13: good version - amptorn
https://qntm.org/files/rot13/rot13.html
======
ChrisSD
Technically ROT13 can only handle 26 characters. The "good" version would be
to deny any inputs outside an accepted character set.

Ok so this doesn't really matter for a joke algorithm like ROT13 but in more
serious cases it's important to refuse any inputs that aren't handled and not
try ad-hoc fixes to make them "work".

~~~
A2017U1
Can a cipher invented 2000 years ago have a technical standard ascribed to it?

~~~
ChrisSD
Caesar ciphers? I believe they are well defined, yes. Although ROT13 itself
only dates back to maybe the 70's or 80's.

Besides, I was honestly just using this as an excuse to make a more general
point. I've grown frustrated with bugs and security issues arising from
"fixing" input to work in a domain which was not designed to handle that
input.

But as I said, it doesn't really matter with ROT13 because it isn't a serious
algorithm.

~~~
astrobe_
> But as I said, it doesn't really matter with ROT13 because it isn't a
> serious algorithm.

Depends on what you use it for. I've seen it used for "spoilers" text when
other tricks were not available.

BTW it is funny that Caesar's cypher cannot handle "Latin" characters.

~~~
menacingly
Rot13 is not Caesar's cipher. Rot13 is in the family of rotational ciphers,
but it's a more modern concept designed around a 26-letter alphabet (so that
running it twice produces the plaintext again)

------
dsr_
øbol comes through as øoby.

Rot13 is not defined for characters outside [a-zA-Z].

~~~
runxel
German "ß" works neither (which could at least be substitued with "ss").

~~~
maxheadroom
Neither does (æ or Æ).

------
mseidl
ROT26 is 2x as secure.

~~~
amptorn
This is a classic entry-level security mistake. You have to pick a work factor
_k_ and then do 2^ _k_ iterations of ROT13.

~~~
anon4242
k=1 FTW!

------
dveeden2
But emoji is not handled correctly, the cleartext and ciphertext are identical

------
xeeeeeeeeeeenu
rot8000[1][2][3] is a similar idea.

[1] - [http://rot8000.com](http://rot8000.com)

[2] -
[https://news.ycombinator.com/item?id=18495518](https://news.ycombinator.com/item?id=18495518)

[3] -
[https://news.ycombinator.com/item?id=6659687](https://news.ycombinator.com/item?id=6659687)

