Skip to main content

A Lattice based Asymetric public-key encryption algorithm based on learning with errors problem.

Project description

LAT-LWE-4

A Lattice(LAT) based Asymetric public-key encryption algorithm based on learning with errors(LWE) problem.

It uses methods which are proposed to be secure against cryptanalytic attack by a quantum computer.

The Name LWE-4 is derived from the max half-error amount percentage during the key generation which comes to around 4 percet thus deriving the name LWE-4

How to use

import LWE4 as lwe
import json
import secrets

# genetaring a test string to encrypt
original_string = secrets.token_hex(16)

# generating the keys for encryption process
private_key,public_key = lwe.keygen.keygen(50,8096)

# converting string data to json
private_key = json.loads(private_key)
public_key = json.loads(public_key)

# using public key to encrypt the test string
encrypted_string = json.loads(lwe.encrypt.encrypt(original_string,public_key))

# decrypting the string using private key
decrypted_string = json.loads(lwe.decrypt.decrypt(encrypted_string,private_key))

# comparing the string to check for error observed for particular public and private key combo
if original_string != decrypted_string:
    print("ERROR",private_key,public_key)

You can directly look into the test.py or brute_force_test.py files from the repo to directly start the testing after cloning the repo. Or you can directly use the Jupyter notebook for testing/playing around in the playground which i had been using for my development preocess.

NOTE !

  • This is still an indevelopment project and shouldn't be used for any production usecase.

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

LWE4-0.0.0.2.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

LWE4-0.0.0.2-py3-none-any.whl (7.4 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