Category:Encryption/rot-caesar-cipher
You are here | rot
|
Description
The ROT cipher, also known as the Caesar cipher was used during the Roman Empire to hide messages transported through battlefields by courier. It consists of shifting letters in the alphabet with a constant (the key).
Suppose the shift key is 2. Here is the conversion table:
Plain | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cipher | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X |
Hence the plain text "MY SECRET MESSAGE" becomes "KW QCAPCR KCQQYEC".
You can decode it with tr. For example, for an offset of 5:
$ echo "vpxoa{eP5o_4_R4mH_pK_1_4421_9952}" | tr 'A-Za-z' 'F-ZA-Ef-za-e' auctf{jU5t_4_W4rM_uP_1_4421_9952}
ROT13
ROT13 is a version of ROT with a shift of 13 letters as follows:
Plain | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cipher | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M |
You can create such an alias:
$ alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'" $ echo -n 'cvpbPGS{guvf_vf_pelcgb!}' | rot13 picoCTF{this_is_crypto!}
ROT47
ROT47 is a shift cipher that improves ROT13 by allowing it to encode almost all visible ASCII characters (where ROT13 could only encode letters).
To achieve this, ROT47 uses a 94-character alphabet that is a subset of the ASCII characters between the character 33 ! and the character 126 ~.
You can use the following alias:
$ alias rot47="tr '\!-~' 'P-~\!-O'" $ echo "*@F DA:? >6 C:89E C@F?5 323J C:89E C@F?5 Wcf E:>6DX" | rot47 You spin me right round baby right round (47 times)
Pages in category "Encryption/rot-caesar-cipher"
This category contains only the following page.