Skip to main content

FrodoKEM implementation and presentation application

Project description

Re-implementation of quantum-secure algorithm FrodoKEM in Python 3.x

About

This is Python implementation of FrodoKEM (Key Exchange Mechanism), as a result of my bachelor, based on Microsoft's implementation in C, but using OOP (and NumPy for matrix operations). FrodoKEM is a key exchange protocol, which security is based on Learning With Errors problem - simply put it is a problem of solving a system of linear equations with probabilistic soluton, and is based on mathematical objects with regular structure called lattices. Additionally, I created a demonstration application as well in a form of "terminal-based chat" (using ncurses implementation in Python) as well as simple benchmark tool allowing the programmer to test efficiency of this implementation. FrodoKEM was implemented as a separate module, which is imported and used in Application module. In a short, Python implementation is several hundreds times slower than C, however it provides some educational value and hopefully better understanding of how this algorithm work. I did my best to at least save Microsoft's comments on what is going on in particular places of the code, as well as put mine in places which I was sure I did understand. Finally, my implementation is much shorter and gives a simple to use, abstract interface for the programmer to use it. It is also most likely as secure as Microsoft's implementation is.

Installation

The source code is currently hosted on GitHub. The latest released version is also available for download via pip:

  # python3 -m pip install frodokem-with-chat

or simply

  # pip3 install frodokem-with-chat

Example

  from FrodoKEM.frodo640.api_frodo640 import FrodoAPI640
  FrodoAPI = FrodoAPI640()
  p, r = FrodoAPI.crypto_kem_keypair_frodo640() # Generate keypair (priv, public)
  c, ss = FrodoAPI.crypto_kem_enc_frodo640()    # Generate ciphertext, shared secret => Party B
  ss1   = FrodoAPI.crypto_kem_dec_frodo640()    # Generate shared secret based on ciphertext => Party A

Documentation

For further details on the usage of these modules, please refer to: Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frodokem_with_chat-1.0.4.tar.gz (21.7 kB view hashes)

Uploaded Source

Built Distribution

frodokem_with_chat-1.0.4-py3-none-any.whl (26.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page