Skip to content
🛠️ToolsShed

Cipher Tool

Encode and decode text with Caesar, ROT13, and Vigenère ciphers.

3

About this tool

A cipher tool enables you to encrypt and decrypt text using classical cryptographic methods: Caesar cipher shifts letters by a fixed number, ROT13 rotates each character by 13 positions (a symmetric technique), and Vigenère cipher applies a repeating keyword to strengthen security. These techniques have been used for centuries to protect sensitive messages, and today they serve as educational tools for understanding encryption principles and for lightweight text obfuscation.

To use this tool, select your preferred cipher method, enter the text you want to encode or decode, and provide any required parameters such as the shift value for Caesar cipher or the keyword for Vigenère cipher. Whether you're learning cryptography basics, playing word games, or creating simple text puzzles for puzzles and challenges, simply paste your text, configure your cipher settings, and instantly see the transformed result.

These classical ciphers are excellent for educational purposes and casual use, but they lack the security of modern encryption standards. For sensitive data, consider using current cryptographic algorithms. This tool is perfect for students, programmers exploring cipher mechanics, puzzle creators, and anyone curious about how historical encryption techniques work.

Frequently Asked Questions

Code Implementation

# Caesar Cipher — encode and decode with any shift (ROT13 = shift 13)

def caesar_encode(text: str, shift: int) -> str:
    result = []
    for ch in text:
        if ch.isalpha():
            base = ord('A') if ch.isupper() else ord('a')
            result.append(chr((ord(ch) - base + shift) % 26 + base))
        else:
            result.append(ch)
    return ''.join(result)

def caesar_decode(text: str, shift: int) -> str:
    return caesar_encode(text, -shift)

# ROT13 is simply shift=13
rot13 = lambda s: caesar_encode(s, 13)

print(caesar_encode("Hello, World!", 3))   # Khoor, Zruog!
print(caesar_decode("Khoor, Zruog!", 3))   # Hello, World!
print(rot13("Hello"))                       # Uryyb
print(rot13("Uryyb"))                       # Hello  (self-inverse)

# Brute-force all 25 shifts to crack a Caesar cipher
ciphertext = "Khoor, Zruog!"
for shift in range(1, 26):
    print(f"Shift {shift:2d}: {caesar_decode(ciphertext, shift)}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.