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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file LWE4-0.0.0.2.tar.gz
.
File metadata
- Download URL: LWE4-0.0.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72949c95a6240ed09124a4f994c7c98d1135c19edd812e825a49a4dddeda462a |
|
MD5 | e73d6e55e76dc33af037d2a293e5e731 |
|
BLAKE2b-256 | f2edc4eb515aed470def5761194537670d4badf4f3a4d02f84fd8161a9bc251c |
File details
Details for the file LWE4-0.0.0.2-py3-none-any.whl
.
File metadata
- Download URL: LWE4-0.0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7add0e882351743496b871a88b380404628288dc3812f49fe8137d966fd6291 |
|
MD5 | d352bd1e6755aac8514b5f6a4812f6b9 |
|
BLAKE2b-256 | b13944545903ca0ce6235a51a81b15a1a33e2da5212a8a8366edd6bd732cb039 |