How ROT5 Works
ROT5 applies a simple substitution to the 10 decimal digits (0-9). Each digit is replaced by the digit 5 positions ahead, with wrapping: 0→5, 1→6, 2→7, 3→8, 4→9, 5→0, 6→1, 7→2, 8→3, 9→4. The formula is: new_digit = (digit + 5) % 10. Because 5 is exactly half of 10, the cipher is self-inverse — applying ROT5 to '67890' returns '12345'. Letters, spaces, and other characters are left unchanged.
ROT5 Combined with ROT13: ROT18
ROT5 is most commonly used alongside ROT13 in a combination called ROT18. ROT18 applies ROT13 to letters and ROT5 to digits simultaneously, obfuscating both alphabetic and numeric content in a single pass. For example, 'Test123' becomes 'Grfg678' under ROT18. The name ROT18 comes from 13 + 5 = 18, though this is informal — it is not a single rotation of 18. ROT18 is useful when you need to obscure alphanumeric strings like serial numbers, codes, or identifiers.
Use Cases for ROT5
ROT5 is used to lightly obfuscate numeric data such as phone numbers, ZIP codes, account numbers, or test data in documentation. Developers sometimes apply ROT5 to numeric portions of configuration files or log data to prevent casual reading. In CTF cybersecurity competitions, ROT5 frequently appears as part of multi-layer encoding challenges. Like all ROT variants, ROT5 provides no real security — it simply makes numbers not immediately recognizable at a glance.
ROT5 Conversion Table
The complete ROT5 mapping is straightforward: 0↔5, 1↔6, 2↔7, 3↔8, 4↔9. Each pair is its own inverse. A phone number like 555-0123 becomes 000-5678 under ROT5. A date like 2024 becomes 7579. The simplicity of the mapping makes ROT5 easy to apply mentally — just add or subtract 5 from each digit, wrapping at 10.