B-1.2 LWE Cryptosystem

The LWE cryptosystem uses the following encryption formula: B = S A + Δ M + E (where S is a secret key, A is a public key randomly picked per encryption, M is a plaintext, E is a small noise randomly picked per encryption from a normal distribution, and B is a ciphertext). Δ is a scaling factor of the plaintext M (shifting M by log2Δ bits to the left). Before encrypting the plaintext, we left-shift the plaintext several bits (i.e., log2Δ bits) in order to secure sufficient space to store the error in the lower bits.

PIC

Figure 8: An illustration of LWE’s plaintext scaling and adding a noise: Δ M + E q

Figure 8 visually illustrates the term Δ M + E, where the plaintext M left-shifted by log2Δ bits and noised by the noise E. The actual encryption and decryption formulas are as follows:

Summary B-1.2 Lattice-based Cryptosystem

Δ means rounding the number to the nearest multiple of Δ. For example, 1610 = 20, which is rounding 16 to the nearest multiple of 10. As another example, 178 = 16, which is rounding 17 to the nearest multiple of 8 (note that 17 is closer to 16 than 24, thus it is rounded to 16).

Correctness: In the decryption scheme, computing BiS Ai gives Δ Mi+ Ei, which is Figure 8. Then, Δ Mi+ EiΔ (i.e., rounding the value to the nearest multiple of Δ) gives Δ Mi, provided the added noise Ei < Δ 2 . That is, if the noise is less than Δ 2 , it will disappear during the rounding. Finally, right-shifting Δ Mi by log2Δ bits gives Mi. To summarize, if we ensure Ei < Δ 2 (which is why the noise Ei should be smaller than this threshold), then we can blow away Ei during the decryption’s rounding process and retrieve the original Δ Mi. The reason we scaled Mi by Δ is to: (i) create the space for storing Ei in the lower bits during encryption such that the noise bits do not interfere with the plaintext bits (to avoid corrupting the plaintext bits); and (ii) blow away the noise Ei stored in the lower bits during decryption without corrupting the plaintext Mi.

Security: Given an attacker has a large list of (Ai,Bi) (i.e., many ciphertexts), it’s almost impossible for him to derive S, because of the random noise Ei added in each encryption (which is a search-hard problem described in §B-1.1). This is because even small added unknown noises Ei greatly change the mathematical solution for S that satisfies all the Bi = S Ai+ Δ Mi+ Ei equations.

Even in the case that the attacker has a large list of (A(j),B(j)) generated for the same ciphertext Mi (where each ciphertext used different A(j) and E(j) to encrypt the same Mi), he still cannot derive Mi, because a randomly picked different noise E(j) is used for every (A(j),B(j)) and gets accumulated over ciphertexts, which exponentially complicates the difficulty of the linear algebra of solving S. Also, in the actual cryptosystem (§B-2), the public key Ai and the secret key S are not a single number, but a long vector comprising many random numbers. Thus, adding AiS to ΔMi+ Ei adds a higher entropy of randomness against the attack.

To summarize, the lattice-based cryptography hides a plaintext by adding the encryption component S A to it as well as a small random noise E. During decryption, the secret key owner re-creates this encryption component A S by using her S and removes it, and then also removes the noise E by the rounding technique, and finally right-shifts the remaining ΔM by log2Δ bits to get M.