Ciphers
ROT-13
A Caesar with shift 13, so it is its own inverse. Encode twice and you are back.
- create
- create("rot13")
- family
- Shift
- options
- none
- self-inverse
- yes
- keyspace
- 1 (fixed shift=13)
- try it
- ciphers rot13 "HELLO WORLD"
Thirteen is half of 26, so shifting twice is a full turn. encode and decode do the same thing, and info().selfInverse admits it. One key, hides nothing. It's the Usenet way of keeping a spoiler out of immediate view, and that is all it was ever for.
const rot13 = create("rot13");
rot13.encode("HELLO").text; // "URYYB"
rot13.encode("URYYB").text; // "HELLO"
rot13.encode("Hello, World! 123").text; // "Uryyb, Jbeyq! 123"
Letters only. Digits and punctuation pass through, and that is the whole difference from ROT-47.