Skip to content

kernelcero/cifrado-cesar-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

🔐 Caesar Cipher in Python

This project is a clean and robust implementation of the Caesar Cipher, developed as part of a learning process and programming mentorship.

🚀 Features

  • Universal Support: Correcty handles uppercase and lowercase letters while preserving special characters (spaces, periods, commas).
  • Mathematical Rotation: Utilizes the modulo operator to allow shifts of any magnitude, ensuring a perfect cyclic rotation through the alphabet.
  • Clean Code: Modular, documented code ready to be integrated as a library into other Python projects.

🛠️ Development Environment

Developed and tested on Linux Mint 2026 using Python 3.12+.

📜 Historical Context

The Caesar Cipher is one of the oldest and most well-known cryptography techniques in history. It is named after the Roman general Julius Caesar, who, according to the historian Suetonius, used it over 2,000 years ago to protect his strategic military communications.

How does it work?

It is a type of substitution cipher. In this scheme, each letter in the original text is replaced by another letter located a fixed number of positions down the alphabet.

For example, with a shift of 3:

  • A becomes D
  • B becomes E
  • X becomes A (completing the circle)

While today this method is considered vulnerable to frequency analysis or brute-force attacks, its study is fundamental to understanding the evolution of information security—from papyrus messages to modern end-to-end encryption systems.

📖 Usage

from caesar_cipher import encrypt, decrypt

message = "Hello World"
secret = encrypt(message, 7)
print(f"Encrypted Message: {secret}")

# To recover the original message:
original = decrypt(secret, 7)
print(f"Original Message: {original}")

About

Implementación educativa del Cifrado César desarrollada en Linux Mint.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages