Coder Social home page Coder Social logo

berkaybarlas / modern-cryptography Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 537 KB

Koc University Comp 443: Modern Cryptography Course project

License: MIT License

Python 100.00%
koc-university cryptography enigma enigma-cipher python3 enigma-simulator enigma-machine

modern-cryptography's Introduction

Modern-Cryptography

Koc University 443: Modern Cryptography Course projects

Project-1

In this project, I implemented Enigma and Bombe with Python3 and completed all the parts in project pdf.

In this project there is also a small example of communication with Enigma.

Even though, Enigma has 3 rotors traditionally, my implemtation of it can have more rotors to increase the break difficult.

For the sake of simplicity, I used default 3 rotors in my examples.

My implementation of rotor has O(1) complexity decrypt, encrypt, turnRotor (click) operations for single letter. Thus, the complexity of same operations for enigma with single letter is O(k) where k is the number of rotors.

How to run

Uncomment test cases and run

# This part includes the test cases for Enigma, Rotor and Bombe
python3 main.py

For secure communication example with enigma run and create two agents

# This part includes an communication example

For instance

# Run from one terminal
python3 agent.py Alice Bob
# Run from another terminal
python3 agent.py Bob Alice

For Enigma breaker

python3 breaker.py
python3 breaker.py targetFile.txt wordList.txt

Additional Functions

# Since my implemantion of enigma is flexible, I used this function to determine the number of possibilities for Bombe
enigma.possiblityNumber()

# To visualize current state of enigma
enigma.visualizeEnigma()

If you are a Koc University Student please read University Code of Conduct rules

Images

agent1 agent2 enigma

modern-cryptography's People

Contributors

berkaybarlas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

milan-sm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.