Skip to main content

Implementation of the Caesar Cipher encryption algorithm in Python. Unlike the classic, it also shifts numbers, symbols & even emojis! Focused on simplicity and Efficiency.

Project description

PyPI version License Test Status Total Downloads PyPI Downloads Repository Visits Issues Stars

CaesarCipher.extended

Simple, creative, and practical Caesar cipher encryption for Python projects.


🚀 Why CaesarCipher.extended?

Ever wanted to add a layer of protection to your data without the complexity of modern cryptography? CaesarCipher.extended 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!


🔑 What is the CaesarCipher.extended?

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:

  • Letters (upper & lower case)
  • Digits (optional)
  • Symbols (optional)
    • Symbols
    • Emojis (some support)

You choose what gets encrypted and how!


✨ Features

  • Encrypt and decrypt text with a customizable shift
  • Optionally include digits and symbols
  • Input validation for safety
  • Intuitive API for quick integration
  • Perfect for small to mid-scale projects
  • Much better than storing plain text

📦 Installation

Install from PyPI:

pip install CaesarCipher.extended

Or clone from GitHub:

git clone https://github.com/ViratiAkiraNandhanReddy/CaesarCipher.extended.git
cd CaesarCipher.extended

🛠️ Usage

Encrypting Text

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())

Decrypting Text

from CaesarCipher import Decryption

# Basic decryption
dec = Decryption("Olssv, Dvysk! 890", shift = 7, isNumbersAltered = True, isSymbolsAltered = True)
print("Decrypted:", dec.decrypt())

File-based Encryption / Decryption

You can encrypt or decrypt files in-place using encrypt_file() and decrypt_file() on the corresponding class instances. Both methods read the file contents, replace the file with the transformed text, and return a boolean indicating success.

from CaesarCipher import Encryption, Decryption

# Encrypt a file in-place
enc = Encryption(shift = 4, alterNumbers = True, alterSymbols = True)
ok = enc.encrypt_file('secrets.txt')
if ok:
		print('File encrypted')

# Decrypt a file in-place
dec = Decryption(shift = 4, isNumbersAltered = True, isSymbolsAltered = True)
ok = dec.decrypt_file('secrets.txt')
if ok:
		print('File decrypted')

Notes:

  • These methods return False when the file does not exist or when the process lacks permission to read/write the file. Other errors will propagate.

📚 API Reference

Encryption

Encryption(text: str, shift: int = 3, alterSymbols: bool = False, alterNumbers: bool = False)
  • text: The string to encrypt
  • shift: How many positions to shift (default: 3)
  • alterSymbols: Shift symbols? (default: False)
  • alterNumbers: Shift digits? (default: False)

.encrypt() -> str

Returns the encrypted string.

Decryption

Decryption(text: str, shift: int = 3, isSymbolsAltered: bool = False, isNumbersAltered: bool = False)
  • text: The string to decrypt
  • shift: 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.


🔍 Comparison Table

See how CaesarCipher transforms your data:

Stage Example Text
Original HelloWorld123!
After Encryption KhoorZruog456!
After Decryption HelloWorld123!

How it works:

  • Encryption shifts each character by a fixed amount (default: 3).
  • Decryption reverses the shift, restoring the original text.

You can customize the shift and choose to include digits and symbols for even more flexibility!


⚠️ Limitations & Security

  • Not for high-security needs! Vulnerable to brute-force and frequency analysis.
  • Symbol shifting may produce non-printable characters.
  • For real password storage, use cryptographic hashes (bcrypt, Argon2, etc).

💡 When Should You Use This?

  • Small to mid-scale projects
  • Obfuscating sensitive data (usernames, passwords, tokens)
  • Educational demos
  • Quick protection for logs or configs

💯 : Some encryption is always better than none. This package is a practical upgrade from plain text!


🌐 Social & Links

LinkedIn X Instagram Facebook Gist YouTube Website PyPI Mail


📝 License

© 2025 ViratiAkiraNandhanReddy. This project is licensed under the GNU GENERAL PUBLIC LICENSE .


👤 Author

Developed by ViratiAkiraNandhanReddy

💤 - PASSIVE MAINTENANCE : Mean the project is no longer actively developed ( NO New Features And Regular Updates ), but the maintainer will respond only when an issue or PR is raised. Feel free to fork and continue development!


Questions, suggestions, or want to contribute? Open an issue or pull request on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caesarcipher_extended-2.9.1.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caesarcipher_extended-2.9.1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file caesarcipher_extended-2.9.1.tar.gz.

File metadata

  • Download URL: caesarcipher_extended-2.9.1.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for caesarcipher_extended-2.9.1.tar.gz
Algorithm Hash digest
SHA256 dfc5802332d33bd956e0122fc51f1466ae9cd11cb23bf6073eeda48ba8cd73d3
MD5 d7d975f7914d025e04c02d73536c3da3
BLAKE2b-256 f3ea3b7a4a13d2f9a599dd1624e010deb487377c66947890906c475345143807

See more details on using hashes here.

File details

Details for the file caesarcipher_extended-2.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for caesarcipher_extended-2.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee2a10627c73bcc8e9df0cc471ef019c4e1a9cd130b242a0787df17c74b91932
MD5 84a067c410173f1bfdf3e7f5f19e5e9e
BLAKE2b-256 dba71eb58de36eb8d5898abfb8c26b510421c057857856bf9d81215a45374be6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page