Docsity

Learning with Errors 2, Schemes and Mind Maps of Cryptography and System Security

Toggle sidebar
bg1
University of Illinois, Urbana Champaign
CS/ECE 498AC3/4 Applied Cryptography
Instructor: Dakshita Khurana
Scribe: Dawei Wang
Date: November 19, 2020
LECTURE
25
Learning with Errors 2
In the previous lecture we discussed the Learning With Errors (LWE) problem which is
defined as: given bi= (< ~ai, ~s > +ei) mod Zq, try to find ~s = (s1, ..., sn) where each si∈Zq.
In fact, people cannot break the LWE problem with quantum resources and this problem is
considered to be quantum secure. In today’s lecture, we continue our discussion for the two
versions of the LWE problem: search LWE assumption, decision LWE assumption. Then
we also discussed constructing encryption from decision LWE assumption.
25.1 Learning with errors
There are two versions of the LWE problem: search LWE assumption, decision LWE as-
sumption and they are considered as one assumption because they imply each other. In
our lecture, we only care about decision LWE since it is much easier to build cryptography
algorithms assuming the decision LWE.
The LWE assumption is defined as follows:
•Sample n bit long prime q
•Sample secrete vector ~s = (s1, ..., sn) where each siis randomly sampled from Zq
•Set m=n2where mcan be any polynomial in n
•For every i∈[m]:
–Sample ~ai= (ai1, ai1, ..., ain) where each aij is sampled randomly from Zq
–Sample a small error ei← X
–Compute scalar bi= (< ~ai, ~s > +ei) mod Zq
•Output ( ~a1, ..., ~am), (b1, ..., bm)
The search LWE assumption states that it is computationally hard to find the secrete ~s
without knowing the noise ei.
The decision LWE assumption says that the adversary cannot distinguish (b1, ..., bm) from
pf3
pf4
pf5

Partial preview of the text

Download Learning with Errors 2 and more Schemes and Mind Maps Cryptography and System Security in PDF only on Docsity!

University of Illinois, Urbana Champaign CS/ECE 498AC3/4 Applied Cryptography

Instructor: Dakshita Khurana Scribe: Dawei Wang Date: November 19, 2020

LECTURE

Learning with Errors 2

In the previous lecture we discussed the Learning With Errors (LWE) problem which is defined as: given bi = (< ~ai, ~s > + ei) mod Zq , try to find ~s = (s 1 , ..., sn) where each si ∈ Zq. In fact, people cannot break the LWE problem with quantum resources and this problem is considered to be quantum secure. In today’s lecture, we continue our discussion for the two versions of the LWE problem: search LWE assumption, decision LWE assumption. Then we also discussed constructing encryption from decision LWE assumption.

25.1 Learning with errors

There are two versions of the LWE problem: search LWE assumption, decision LWE as- sumption and they are considered as one assumption because they imply each other. In our lecture, we only care about decision LWE since it is much easier to build cryptography algorithms assuming the decision LWE.

The LWE assumption is defined as follows:

  • Sample n bit long prime q
  • Sample secrete vector ~s = (s 1 , ..., sn) where each si is randomly sampled from Zq
  • Set m = n^2 where m can be any polynomial in n
  • For every i ∈ [m]:
    • Sample a~i = (ai 1 , ai 1 , ..., ain) where each aij is sampled randomly from Zq
    • Sample a small error ei ← X
    • Compute scalar bi = (< ~ai, ~s > + ei) mod Zq
  • Output ( a~ 1 , ..., ~am), (b 1 , ..., bm)

The search LWE assumption states that it is computationally hard to find the secrete ~s without knowing the noise ei. The decision LWE assumption says that the adversary cannot distinguish (b 1 , ..., bm) from

uniformly random values. That is, define adversary A to be what we described above and adversary AR^ having randomly sampled values (b 1 , ..., bm), then:

P r[A( a~ 1 , ..., ~am, b 1 , ..., bm) = 1] − P r[AR( a~ 1 , ..., ~am, b 1 , ..., bm) = 1] = negl(n)

25.2 Symmetric key encryption from LWE

Once we assume that solving the decision LWE problem is computationally hard, we can construct an encryption scheme that relies on this hardness. The encryption scheme works as follows:

  • KeyGen(r): for some randomness r, sample secrete vector ~s = (s 1 , ..., sn)
  • Enc(s, m, r′): given a secrete vector s, a message m, and randomness r′. First sample a, e use the randomness r′. Then compute (a, (< a, s > +e) + m

⌊ (^) q 2

  • Dec(s, ct): given secrete vector s and cipher text ct, parse ct = (a, b).
    • Output 0 if b − < a, s > mod q ∈ [− q 4 , q 4 ]
    • Output 1 if b − < a, s > mod q ∈ [ q 4 , 34 q ]

25.3 Proof of single message security

To prove single message security, we only need to prove that Enc(s,0,r) ≈c Enc(s,1,r), which means that the 2 encryption are computationally indistinguishable. We define:

Enc(s, 0 , r) = (a, < a, s > +e)

Enc(s, 1 , r) = (a, < a, s > +e +

⌊ (^) q 2

By decision LWE assumption:

(a, < a, s > +e) ≈c (a, b)

(a, < a, s > +e +

⌊ (^) q 2

) ≈c (a, b +

⌊ (^) q 2

Since a, b are uniformly random, constant offset of uniform distribution is identical to uniform, which means that:

(a, b) = (a, b +

⌊ (^) q 2

This proved that Enc(s,0,r) ≈c Enc(s,1,r) and the encryption scheme at 25.2 is secure for single message.

25.6 Public key encryption from LWE

We can model the public key encryption scheme using Alice and Bob and the LWE matrix representation. Alice chooses a secret key s and a random n × m matrix A. And the public key is (A, bT^ ) where A ← Znq ×m, e ← X m, b = (sT^ A + eT^ )T^. In order to encrypt a message to Alice, Bob chooses an m-dimensional binary vector r and calculate u = Ar. Then the main cipher text is u′^ = br + m

⌊ (^) q 2

where m is Bob’s message. In order to decrypt the message, Alice subtracts information dependent on her secret key which is u′^ − sT^ u ≈c m

⌊ (^) q 2

The whole public key encryption algorithm works as follows:

  • KeyGen(r):
    • sk = ~s ← Zn q×^1
    • pk = (A, bT^ = sT^ A + eT^ ) where A ← Znq ×m, e ← X m×^1. Note that we require X is set s.t. samples from X ∈ [− 4 qm , 4 qm ]. This is important for the correctness.
  • Enc(m, pk, r):
    • Parse pk = (A,~bT^ )
    • Sample vector ~r ← { 0 , 1 }T
    • Compute C~n× 1 = An×m~rm× 1
    • Compute d = (~bT 1 ×m~rm× 1 + m

⌊ (^) q 2

) mod q

  • Enc(m, pk, r) = ( C~, d)
  • Dec(ct, pk):
  • Parse ct = ( C~, d)
  • Compute α = ~sT 1 ×n C~n× 1 = ~sT^ A~r
  • Compute β = (d − α) = m

⌊ (^) q 2

  • ~bT^ ~r − sT^ A~r = ~eT^ ~r
  • Output m = 0 if β ∈ [− q 4 , q 4 ], else output m = 1

25.7 Proof of public key encryption security

Previously in the public-key setting, we already showed that single message CPA is the same as multi message CPA. So all we need to approve is single message CPA security, that is, (pk, Enc(pk, 0 , r)) ≈c (pk, Enc(pk, 1 , r)). By definition:

(pk, Enc(pk, 0 , r)) = (A, ~sT^ A + eT^ ), (A~r,~bT^ ~r) ≈c (A,~bT^ ), (A~r,~bT^ ~r) where b ← Zmq

(pk, Enc(pk, 1 , r)) = (A, ~sT^ A + eT^ ), (A~r,~bT^ ~r +

⌊ (^) q 2

) ≈c (A,~bT^ ), (A~r,~bT^ ~r +

⌊ (^) q 2

) where b ← Zmq

Define matrix E = (A,~bT^ ), then we get:

(pk, Enc(pk, 0 , r)) = (E, Er)

(pk, Enc(pk, 1 , r)) = (E, Er +

⌊ (^) q 2

Apply the Leftover Hash Lemma, we have:

Er ≈c uniform random vector = uniform random vector +

⌊ (^) q 2

≈c Er +

⌊ (^) q 2

Thus, we proved the public key encryption security.

Acknowledgement

These scribe notes were prepared by editing a light modification of the template designed by Alexander Sherstov.