Mã hóa ROT-X¶
Estimated time to read: 2 minutes
Mar 01, 2021 · ~5 minutes
Something about ROT-X which I know¶
ROT-X ("rotate by X places", sometimes hyphenated ROT-X) is a simple letter substitution cipher that replaces a letter with the Xth letter after it in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome.
Because there are 26 letters (2×13) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding. The algorithm provides virtually no cryptographic security and is often cited as a canonical example of weak encryption. It means encrypt(encrypt(message)) = decrypt(message).
ROT131 is used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from casual glance. ROT13 has inspired a variety of letter and word games online and is frequently mentioned in newsgroup conversations.
In a general way: encrypt(message) with ROT-X = decrypt(message) with ROT-(26-X)
Example:
- Encrypt(message) with ROT1 = decrypt(message) with ROT25
- Decrypt(message) with ROT1 = encrypt(message) with ROT25
- Special case with ROT13: decrypt(message) = encrypt(encrypt(message))
Expanding the alphabet (can add a special character such as "[, ], {, }, 1, 2, 3, 4, 5, 6, 7, 8, 9, ), ...", then according to the operating mechanism of the ROT-X cipher, we can easily decode or encode them.
-
See more https://vi.wikipedia.org/wiki/ROT13 ↩