Skip to content

saralnajjar/classical-ciphers-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classical Ciphers - Python

A command-line tool implementing three classical encryption ciphers in Python.

Ciphers Included

Shift (Caesar) Cipher Each letter is shifted a fixed number of positions forward or backward in the alphabet. Non-alphabetic characters are preserved. Named after Julius Caesar, who reportedly used a shift of 3.

Substitution Cipher Each letter is replaced by a corresponding letter from a randomly shuffled alphabet permutation. Produces a more complex encryption than the shift cipher since each letter maps to a unique but unpredictable replacement.

Vigenère Cipher Uses a repeating keyword to derive a different shift value for each letter of the plaintext. Significantly harder to break than the Caesar cipher as the same letter can encrypt to different ciphertext letters depending on its position.

Usage

Run the tool from the command line:

python3 main.py

You will be prompted to:

  1. Choose a cipher (Shift, Substitution, or Vigenère)
  2. Choose to encrypt or decrypt
  3. Enter your text
  4. Enter a key (shift value or keyword depending on cipher)

Example

=== Classical Cipher Tool ===

Choose a cipher:
1. Shift (Caesar)
2. Substitution
3. Vigenere

Enter 1, 2 or 3: 3
Encrypt or Decrypt? (e/d): e
Enter text: Hello World
Enter keyword: SECRET

Encrypted: ZINCSZBVSY

Project Structure

classical-ciphers-python/
├── main.py                  # CLI entry point
├── shift_cipher.py          # Caesar/Shift cipher implementation
├── substitution_cipher.py   # Substitution cipher implementation
└── vigenere_cipher.py       # Vigenère cipher implementation

Requirements

Python 3.x - no external dependencies.


Part of coursework for COMP2860 Cryptography, University of Leeds.

About

Command-line tool implementing three classical encryption ciphers in Python: Caesar/Shift, Substitution, Brute Force, and Vigenère.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages