Skip to content

wangjiacheng1219/python-cryptography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Cryptography

This repository contains Python implementations of classical cryptographic algorithms and cryptanalysis techniques developed during the Elements of Applied Data Security M course at the University of Bologna.

The original coursework was completed as a team project. The version published here has since been reorganized, refined, and documented by Jiacheng Wang, with a few more updates hopefully to come.


Course Information

This project is inspired by the following course:


Repository Goals

  • Implement cryptographic algorithms in Python.
  • Explore practical cryptanalysis techniques.
  • Document the mathematical concepts introduced during the course.
  • Extend the project with additional algorithms and experiments.

Repository Structure

python-cryptography/
│
├── README.md
├── LICENSE
├── .gitignore
│
└── Substitution_Ciphers/
    ├── Substitution_Ciphers.ipynb
    ├── ciphertext_affine.txt
    ├── ciphertext_caesar.txt
    ├── ciphertext_simple.txt
    ├── distribution.pkl
    └── wikipedia_cybersecurity.txt

The Substitution_Ciphers folder contains:

  • A Jupyter notebook with the implementations and experiments
  • Ciphertext files used for cryptanalysis exercises
  • English-language frequency-distribution data
  • Sample text used for encryption and frequency analysis

Quick Start

Requirements

  • Python 3.10 or later
  • Jupyter Notebook

Install the required packages:

pip install numpy matplotlib jupyter

Clone the repository:

git clone https://github.com/wangjiacheng1219/python-cryptography.git
cd python-cryptography

Launch Jupyter Notebook:

jupyter notebook

Then open:

Substitution_Ciphers/Substitution_Ciphers.ipynb

Run the notebook cells from top to bottom.


Current Contents

The current notebook covers classical substitution ciphers and related cryptanalysis techniques, including:

  • Caesar cipher
  • Affine cipher
  • Simple substitution cipher
  • Brute-force key search
  • Letter-frequency analysis

Future Plans

Planned extensions include:

  • Additional classical ciphers
  • Modern cryptographic algorithms
  • More detailed mathematical explanations
  • Separate notebooks for individual topics
  • Performance comparisons and experiments

Acknowledgements

I would like to express my sincere gratitude to Dr. Alex Marchioni for designing and teaching the 90392 – Elements of Applied Data Security M course and for providing the official course materials that inspired this project.

I would also like to thank my teammates, Muhammad Usman Afzal and Peisong Xu, for being part of the Codebreakers team and for their collaboration on the original course assignments.

This repository is not an official course repository. Any modifications, reorganization, and future additions are my own.


License

This project is released under the MIT License.

About

A growing collection of Python implementations of cryptographic algorithms, cryptanalysis techniques, and related mathematical concepts.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors