This article should give a short example, how lattice based encryptions are working.
Following parameters are given. n is the number of matrixes, which are choosen. k is the dimension of every matrix and q must be a prime number, to limit the size of fields.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_1.png)
Alice will choose a Matrix A. This is her public key.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_2-300x114.png)
She will also choose here secret key s.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_3-300x258.png)
Now Alice will choose a random vector e.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_4-300x252.png)
Alice will calculate t with her public key A, her secret key S and her random vector e.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_5-300x65.png)
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_6-1-300x270.png)
Bob will receive A and t from Alice.
Bob will choose a random vector r, e1, e2 and he will select the message M he like to send.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_7-300x151.png)
Bob will now calculate an encryption and a kind of helper encryption output for Alice.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_8-300x109.png)
Now Bob will calculate his secret message.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_9-300x113.png)
Alice will decript the message with using u and v from Bob and her private key s.
![](https://tidecoin.co/wp-content/uploads/2023/01/lattice_example_10-300x116.png)