Giter Site home page Giter Site logo

ntru-python-with-lat-attack's Introduction

NTRU Implementation in Python 3

This is a basic implementation of the NTRU Cryptosystem completed as university coursework.

Disclaimer: This is not a complete or secure implementation and should not be used as anything other than an educational tool.

Some of the details of this system were taken from https://github.com/jkrauze/ntru , such as certain polynomial coercion operations, and parts of the commandline interface. However, the majority of the program is completely different.

Usage

./ntru.py gen [N] [p] [q] [PRIVATE_KEY_FILE] [PUBLIC_KEY_FILE]
./ntru.py enc [PUBLIC_KEY_FILE [CIPHERTEXT] [MESSAGE_FILE]
./ntru.py dec [PRIVATE_KEY_FILE] [CIPHERTEXT_FILE]
./ntru.py att [PUBLIC_KEY_FILE] [CIPHERTEXT_FILE]

The best explanation of how to use the system is to look at the testing script outlined below.

Sample usage

The bash script "test.sh" generates and encrypts a message contained in the "message.txt" file. It then decrypts the ciphertext using the public key, then attacks the cryptosystem with a lattice attack.

Though it should be able to handle any size of text, the program is quite slow and a large plaintext could take a while to encrypt and decrypt.

The attack is only particularly successful for N less that 45.

William Cashman 2019

ntru-python-with-lat-attack's People

Contributors

wlcsm avatar

Stargazers

 avatar Musa Dzhabirov avatar

Watchers

 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.