A bare bones python implementation of the Learning with Errors (LWE) post quantum encryption algorithm. LWE provides resistance against quantum computers by using randomly generated matrices over integers modulo a prime number.
LWE relies on the hardness of distinguishing random linear equations from those with added small errors.
We begin with the following constant values:
A vector length of
A discrete integer secret
A randomly selected prime integer
We then generate a public key made up of length
Each
Each
Each
Next we choose various random indexes
(
We let
To encrypt, we implement.
Where
The single encryped bit is now stored in
To decrypt, the we follow:
Bit =
Original algorithm invented by Oded Regev. This python implementation was created by: Justin Newman.
Based on a lesson by Bill Buchanan OBE. Bill Buchanan OBE. https://youtu.be/MBdKvBA5vrw?feature=shared
Contributions are welcome!