Homomorphic Encryption with Learning With Errors (LWE)
We secure data in its transit, and at its rest, but what happens in process? Well, we are perhaps moving into a world which will protect data at every point of its journey. This will be a world of homomorphic encryption.
LWE
Learning With Errors (LWE) is a quantum robust method of cryptography. Initially we create a secret value (s) and which is our private key. We then create a public key which is based on random numbers (A), and then generate another set of numbers (B) which is based on A, s and random errors e. In this case we will show how a 4-bit value can be encrypted. In this case we will convert an integer to a 4-bit value, and then cipher each of the bits. This is achieved by generating a public key, and then sampling the public key for each of the bits.
First we select a random series of values for our public key (A). For example, let’s select 20 random values from 0 to 100:
[80, 86, 19, 62, 2, 83, 25, 47, 20, 58, 45, 15, 30, 68, 4, 13, 8, 6, 42, 92]
Next we add create a list (B) and were the elements are Bi=Ais+ei(modq), and where s is a secret value, and e is a list of small random values (the error values). If we take a prime number (q) of 97, and an error array (e) of:
[3, 3, 4, 1, 3, 3, 4, 4, 1, 4, 3, 3, 2…