MATH 470 Lecture 19
« previous | Thursday, March 28, 2013 | next »
Tests will be graded by tomorrow, and are viewable during office hours on Monday 11:00 – 12:30
From Yesterday
The secret was 23:
Three pairs for group were:
- (12,96)
- (38,25)
- (2,17)
Randomness and Collisions: The Birthday Paradox
What are the chances that among 25 people, there exist at least 2 people with the same birthday?
Very likely: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 1 - Pr[\text{no common birthdays}]} , and the probability that there are no common birthdays is
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 1 \cdot \frac{364}{365} \cdot \frac{363}{365} \dots = \prod_{j=1}^{24} \left( 1 - \frac{j}{365} \right)}
With a little work, we can get an estimate:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \prod_{j=1}^{24} \left( 1 - \frac{j}{365} \right) \ge 1 - \mathrm{e}^{-\frac{25(25-1)}{2(365)}}}
Similarly, when picking Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle r} numbered balls (with replacement) out of an urn with , the probability of getting a collision is at least
Back to Signatures: Priority
This is an example of "Blind" Signatures
Suppose Pfizer and Roche are developing a cure for cancer. They are entering trials with patients, but want to later claim priority.
They want to prevent espionage by the other company.
If they want the CDC to believe their claim of priority, all parties can do the following:
Reveal that you know something without telling anyone what it is.
- CDC generates 2 RSA instances: and .
- CDC sends set 1 to Pfizer and set 2 to Roche
- Pfizer picks a random and sends to the CDC.
- The CDC signs by computing and sends it back to Pfizer
- Pfizer keeps
- Roche does the same with subscript 2
Each message is the formula for the cancer drugs.
Assuming these dialogues happened today (28 Mar. 2013), when trials are done, Pfizer (or Roche) can say: "I was first!" and prove it:
Proof. Pfizer observes
CRC evaluates
Now in order for this to work, the CDC must be honest
Hash Functions
For digital signatures to be practical, we need to sign digests of messages instead of messages because RSA and El Gamal run in cubic time, not linear time (i.e. slow).
How do we get a digest?
Simple idea: use first few hundred bits
However, this can lead to collisions if two messages start with the same thing.
Mathematically, we want a function
(maps bit strings of length to bit strings of length )
such that
- can be computed relatively quickly ()
- is pre-image resistant, i.e. given , finding with is very hard.
- is strongly collision-free: it is very hard to find and with [1]
Example Hash Functions
-
- (1 passes) easy to compute
- (2 fails) given Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y} , it's easy to find Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m'} with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(m') = y} , namely Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m' = y} .
- (3 fails) take Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(m_1) = H(m_1 + n)}
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(x) = \alpha^x \pmod{p}}
- (1 passes) easy
- (2 passes) discrete log is hard
- (3 passes) only if Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha} is a generator for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p}
- BUT range is still considerably big: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(13081) \equiv 5^{13081} \equiv 103103 \pmod{104729}}
Digression: Transmitting Keys via RSA
Suppose you want to transmit a 56-bit (< 1017) DES key using RSA with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n} having 200 bits (> 1060).
You would like your adversary to be forced to search through all possibilities if she tries to read your message.
However, using RSA naïvely enables Eve to find the 56-bit key after searching just 2E9 possibilities!
- Compute Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y^{-e} \pmod{n}} for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y \in \{ 1, \ldots, 10^9 \}}
- Upon seeing your message Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle c = m^e} , she computes Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle c \, x^e} for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x \in \{ 1, \ldots, 10^9 \}}
- Now Eve looks for collisions Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y^{-e} = c\,x} by checking Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \binom{10^9}{2} \le 10^{18}} possibilities in total, BUT
- Thanks to the birthday paradox, Eve will find a collision with probability 2E9 checks!
The collisions work because Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y^{-e} = c \, x^e \iff c = (x\,y)^{-e} = ((x\,y)^{-1})^e}
, and so Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m = (x\,y)^{-1}}
Eve just found an encrypted key with relatively little work
What to do!?
Padding
Concatenate 72 random bits to the front and back of the key.
This still is not quite secure: Eve could figure out how the padding scheme works
OAEP-Padding Scheme
1994: Bellaire and Rogaway
Based on hash functions, but performs the inverse Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \{ 0,1 \}^n \to \{0,1\}^N} mapping.
Footnotes
- ↑ Sometimes, it's enough to have Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H} be weakly collision-free: given Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x} it is very hard to find Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x'} with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(x) {{=}} H(x')} .