This demo illustrates the Learning With Errors (LWE) encryption scheme. You can modify the parameters, private key, error vector, message bit, and selected indices to see how they affect the encryption and decryption process.
The private key $s \in \mathbb{Z}_p^n$ is generated at random.
Public key
$m$ random vectors $a_i \in \mathbb{Z}_p^n$ are generated to produce a $m \times n$ matrix $A$, and the error vector $e \in \mathbb{Z}_p^m$ is generated with small random values. Then, the vector $b \in \mathbb{Z}_p^m$ is computed as: