An open API service indexing awesome lists of open source software.

https://github.com/jacksonwalters/open-encrypt

Encrypted messaging webapp using lattice-based methods in Python + PHP + SQL
https://github.com/jacksonwalters/open-encrypt

cryptography encryption homomorphic-encryption lattice-based lattice-based-cryptography module-lwe php post-quantum post-quantum-cryptography python ring-lwe sql

Last synced: about 1 month ago
JSON representation

Encrypted messaging webapp using lattice-based methods in Python + PHP + SQL

Awesome Lists containing this project

README

        

# open-encrypt
Full-stack encrypted messaging application using lattice-based methods in Python + PHP + SQL.

**NOTE**: This is a demo for educational purposes only. It is not meant for real-world use.

**ENCRYPTION METHODS**: ring-LWE, module-LWE

**RESOURCES**:

- ring-LWE in Python: https://blog.openmined.org/build-an-homomorphic-encryption-scheme-from-scratch-with-python/
- ring-LWE math: https://math.colorado.edu/~kstange/teaching-resources/crypto/RingLWE-notes.pdf
- module-LWE in Python: https://cryptographycaffe.sandboxaq.com/posts/kyber-01/
- Red Hat Post-Quantum/Lattices: https://www.redhat.com/en/blog/post-quantum-cryptography-lattice-based-cryptography
- NIST Post-Quantum: https://csrc.nist.gov/projects/post-quantum-cryptography
- Latticed-based cryptography: https://thelatticeclub.com

---

**SQL**:

- Three tables are required to store login_info, messages, and public_keys.
- Passwords are hashed using standard hashing.
- Secure, random tokens stored for user sessions.
- Messages are stored encrypted. The inflation ratio is ~13.7 for ring-LWE.
- For ring-LWE, public keys are a `string` representing two (cyclotomic, modular) polynomials as `int` arrays.
- For module-LWE, public keys are a `string` representing a matrix `A` and vector `t` with (cyclotomic, modular) polynomial coefficients.

**PHP**:

Used to handle basic account creation, login, and SQL insertions/lookups.

**Python**:

Python scripts are executed directly using `shell_exec`. Output is printed and passed back as a string.