Skip to main content

๐Ÿ—บ๏ธ Hidden Messages

The MLWE Problem - Intuitionโ€‹


๐ŸŽฏ The Simple Storyโ€‹

Alice wants to send a secret message to Bob.

Problem: Eve is listening to everything!

Alice's idea:

  1. Multiply Bob's secret "code word" by a known "multiplier"
  2. Add some "fog" (noise) to the result
  3. Send the foggy message

Eve sees: A foggy message, but doesn't know if it's fogged this way or that way...

Bob knows: His secret code word! So he can "un-fog" it with his knowledge.

Eve can't: Doesn't know the secret code! Can't figure it out!

That's the core idea behind ML-KEM's security!


๐Ÿง  Mental Modelโ€‹

Hold this picture in your head:

Alice sends message:

Message = Multiplier ร— Secret + Fog

โ†“
Eve sees: "123" (but doesn't know the original!)
โ†“
Could be: 30ร—2 + 63 = 123
Could be: 41ร—3 + 0 = 123
Could be: 60ร—2 + 3 = 123
โ†“
Eve: "Which one is it?" ๐Ÿ˜ฐ

Bob knows: Secret = 2
โ†“
Bob computes: (Message - Fog) รท Multiplier = Secret โœ“

Think of it like:

๐ŸŽญ Secret่—ๅœจ่ฟท้›พไธญ (Secret hidden in fog)

๐ŸŽฏ ้’ฅๅŒ™็š„่ฐœ (Alice's idea: multiply secret by something, fog it up)

๐Ÿ”“ ๆ˜Žๆ–‡ (Bob: has the key = un-fogs it!)


๐Ÿ“Š See It Happenโ€‹

Let's watch Alice send a message to Bob:


๐ŸŽฎ Try It Yourselfโ€‹

Question 1: Alice sends "22". She tells you: "This is Multiplier ร— Secret + Fog". If Multiplier = 5 and Fog = 2, what's Secret?

Show Answer

Equation: 22 = 5 ร— Secret + 2

Bob (who knows the algorithm):

  1. Subtract fog: 22 - 2 = 20
  2. Divide by multiplier: 20 รท 5 = 4

Answer: Secret = 4


Question 2: Eve sees "27". She knows Multiplier = 5. What are all the possible (Secret, Fog) pairs?

Show Answer

Equation: 27 = 5 ร— Secret + Fog Fog = 27 - 5 ร— Secret

Fog must be small (let's say between -2 and 2)

Try possibilities:

  • Secret = 5: Fog = 27 - 25 = 2 โœ“
  • Secret = 6: Fog = 27 - 30 = -3 โœ— (too negative)
  • Secret = 4: Fog = 27 - 20 = 7 โœ— (too positive)

Only possibility: Secret = 5, Fog = 2

But in ML-KEM, Eve doesn't know the range of fog! So Eve would have to try:

  • Secret = 0, 1, 2, 3, 4, 5, 6, ...
  • For each, check if Fog is "reasonable"

That's a LOT of possibilities!


Question 3: If Eve doesn't know the Fog distribution, what's her challenge?

Show Answer

Eve sees "27" with Multiplier = 5

She thinks: "Is Secret = 1? Then Fog = 22" "Is Secret = 2? Then Fog = 17" "Is Secret = 3? Then Fog = 12" "Is Secret = 4? Then Fog = 7" "Is Secret = 5? Then Fog = 2" "Is Secret = 6? Then Fog = -3"

But she doesn't know: Which one is "reasonable"?

Without knowing Fog distribution, she can't eliminate any!

That's why the problem is hard!


๐Ÿ”ข The Mathโ€‹

The Basic LWE Equationโ€‹

The Learning With Errors (LWE) problem is:

As+e=b\mathbf{A}\mathbf{s} + \mathbf{e} = \mathbf{b}

Breaking it down:

  • A\mathbf{A} = Known matrix (multiplier)
  • s\mathbf{s} = Secret vector (what we're hiding)
  • e\mathbf{e} = Error vector (noise/fog)
  • b\mathbf{b} = Observed result (what Eve sees)

In words:

Multiply matrix by secret, add error โ†’ foggy result

Why It's Hard Without Errorโ€‹

If e=0\mathbf{e} = \mathbf{0} (no error): As=b\mathbf{A}\mathbf{s} = \mathbf{b}

This is linear algebra! We can solve: s=Aโˆ’1b\mathbf{s} = \mathbf{A}^{-1}\mathbf{b}

Easy! โœ…

With e\mathbf{e} (with error): As+e=b\mathbf{A}\mathbf{s} + \mathbf{e} = \mathbf{b}

Now e\mathbf{e} is unknown too! Too many solutions!

Hard! ๐Ÿ˜ฐ

Module-LWE (MLWE)โ€‹

MLWE uses the same equation, but with matrices of polynomials:

As+e=t\mathbf{A}\mathbf{s} + \mathbf{e} = \mathbf{t}

Where:

  • AโˆˆRqkร—k\mathbf{A} \in R_q^{k \times k} = Matrix of polynomials (multiplier)
  • sโˆˆRqk\mathbf{s} \in R_q^k = Vector of polynomials (secret)
  • eโˆˆRqk\mathbf{e} \in R_q^k = Vector of polynomials (error)
  • tโˆˆRqk\mathbf{t} \in R_q^k = Vector of polynomials (foggy result)

Even harder! (more dimensions, more structure)


๐Ÿ’ก Why We Careโ€‹

MLWE = ML-KEM's Security Foundationโ€‹

ML-KEM's entire security is based on MLWE being hard!

MLWE in ML-KEM Key Generationโ€‹

Bob does this during key generation:

t=As+e\mathbf{t} = \mathbf{A}\mathbf{s} + \mathbf{e}

Bob knows: s\mathbf{s} (his secret)

Eve knows: A\mathbf{A} and t\mathbf{t} (public key)

Eve wants: Find s\mathbf{s}

Problem: Eve doesn't know e\mathbf{e} (the error vector!)

Result: Eve can't solve for s\mathbf{s} efficiently!


โœ… Quick Checkโ€‹

Can you explain LWE to a 5-year-old?

Try saying this out loud:

"Alice wants to hide a secret. She multiplies it by something, adds some 'fog' (random numbers), and sends the foggy result. Even though Eve sees the foggy result, she can't figure out the original secret because there are too many possibilities! But Bob knows the secret, so he can reverse the process."

Can you work with the LWE equation?

Try this examples:

Given: A=[3,5]\mathbf{A} = [3, 5], t=[10]\mathbf{t} = [10]

Find: s\mathbf{s} and e\mathbf{e} such that As+e=t\mathbf{A}\mathbf{s} + \mathbf{e} = \mathbf{t}

Assume error is small (say: -2, -1, 0, 1, 2)

Try possibilities:

  • s=0\mathbf{s} = 0: As=6\mathbf{A}\mathbf{s} = 6, so e=[10โˆ’6]=[4]\mathbf{e} = [10 - 6] = [4] โœ— (too large)
  • s=1\mathbf{s} = 1: As=8\mathbf{A}\mathbf{s} = 8, so e=[10โˆ’8]=[2]\mathbf{e} = [10 - 8] = [2] โœ“ (reasonable!)

One solution: s=[1],e=[2]\mathbf{s} = [1], \mathbf{e} = [2]

But there are many! Try others too.


๐ŸŽ“ Key Takeawaysโ€‹

โœ… LWE equation = As+e=b\mathbf{A}\mathbf{s} + \mathbf{e} = \mathbf{b} โœ… Without error = Linear algebra (easy) โœ… With error = Unknown error vector (hard) โœ… Eve's problem = Too many (s, e) pairs possible โœ… Bob's advantage = Has s\mathbf{s} (secret) โœ… ML-KEM = Based on MLWE hardness โœ… MLWE in practice = t=As+e\mathbf{t} = \mathbf{A}\mathbf{s} + \mathbf{e} with polynomial matrices


๐ŸŽ‰ What You'll Learn Nextโ€‹

Now you understand the MLWE intuition! Next, we'll learn about:

๐ŸŒซ๏ธ Adding Fog to Maps โ†’ Error in MLWE

Why adding noise doesn't help Eve but keeps ML-KEM usable!