Simple, creative, and practical Caesar cipher encryption for Python projects.
Ever wanted to add a layer of protection to your data without the complexity of modern cryptography? CaesarCipher.encryption brings the classic Caesar cipher to Python, making it easy to obfuscate text, passwords, usernames, and more. Itβs not military-grade, but itβs a huge step up from plain text!
The Caesar cipher is one of the oldest and simplest encryption techniques. Each character in your text is shifted by a fixed number of positions. This package extends the classic algorithm to support:
You choose what gets encrypted and how!
Install from PyPI:
pip install CaesarCipher.extended
Or clone from GitHub:
git clone https://github.com/ViratiAkiraNandhanReddy/CaesarCipher.encryption.git
cd CaesarCipher.encryption
from CaesarCipher import Encryption
# Basic encryption
enc = Encryption("Hello, World! 123")
print("Encrypted:", enc.encrypt())
# Advanced: shift everything
enc2 = Encryption("Secret123!", shift = 7, alterNumbers = True, alterSymbols = True)
print("Encrypted:", enc2.encrypt())
from CaesarCipher import Decryption
# Basic decryption
dec = Decryption("Olssv, Dvysk! 890", shift = 7, isNumbersAltered = True, isSymbolsAltered = True)
print("Decrypted:", dec.decrypt())
Encryption(text: str, shift: int = 3, alterSymbols: bool = False, alterNumbers: bool = False)
text
: The string to encryptshift
: How many positions to shift (default: 3)alterSymbols
: Shift symbols? (default: False)alterNumbers
: Shift digits? (default: False).encrypt() -> str
Returns the encrypted string.
Decryption(text: str, shift: int = 3, isSymbolsAltered: bool = False, isNumbersAltered: bool = False)
text
: The string to decryptshift
: How many positions to shift back (default: 3)isSymbolsAltered
: Were symbols shifted? (default: False)isNumbersAltered
: Were digits shifted? (default: False).decrypt() -> str
Returns the decrypted string.
See how CaesarCipher transforms your data:
Stage | Example Text |
---|---|
Original | HelloWorld123! |
After Encryption | KhoorZruog456! |
After Decryption | HelloWorld123! |
How it works:
You can customize the shift and choose to include digits and symbols for even more flexibility!
Some encryption is always better than none. This package is a practical upgrade from plain text!
This project is licensed under the GNU GENERAL PUBLIC LICENSE
.
β οΈ UNMAINTAINED : This project is currently unmaintained. Feel free to fork and continue development!