Giter Site home page Giter Site logo

comp7401-feistel-cipher's Introduction

Introduction

The purpose of this assignment is the explore the Feistel cipher and also to help us understand how DES and Triple DES function. It teaches us about multi round ciphers but also the importance of the algorithm and method used to encrypt data for easy encryption and decryption with the right key but making it near impossible to reverse.

Constraints

We will be limiting our development to the following:

  • Python as the development language

  • N Rounds of the feistel cipher

  • Subkey generation

  • ECB and CBC modes

  • 64 bit blocks (8 bytes)

Action Plan

Development Plans are as follows:

  1. Create a simple "scramble" function which will hide the data while following the rules of the feistel cipher and be easy enough to encrypt and decrypt

  2. Execute the encrypt by hand on paper to verify the validity of the approach and that indeed is reversible and functional

  3. Write Pseudo of how we initially intend to execute the idea

    1. Please note that our actual code does differ from this but this was the initial approach to the application

Formulas:

  1. f(x, k) = [(2i * k)^x] % ( 2^32 -1)

  2. Li = Ri - 1

  3. Ri = L[i-1] XOR f(R[i-1], ki)

Instructions

Feistel.py can be used for decrypting and encrypting by setting the flag -d (decrypt) or -e (encrypt)

Feistel.py is run using python version 2.

To encrypt a file please run:

**Feistel.py -e -m <ecb|cbc> -t <plaintext file> -k <key> -o <ciphertext file>**

Feistel-decrypt.py is run using python version2.

To decrypt a file please run:

**Feistel.py -d -m <ecb|cbc> -t <ciphertext file> -k <key> -o <resulting plaintext file>**

Please make sure you have the input files for both feistel.py and feistel-decrypt.py in the same directory as the script.** **

comp7401-feistel-cipher's People

Contributors

ffgtu avatar

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.