Lecture 2 (Weds 9/23/97)

Scribes: Edwin Chan, Adrian Perrig, Lian Keng Lim, Andy Myers

Elliptic curve cryptography:

The problem with using the integers is that there is only one set of them. We'd like to have more choices.

Elliptic curves are cubic equations in 2 variables: y2 = x3 + Ax + B mod n. Each curve gives a distinct set of points, and we can define operations on them analogous to the operations we use on the integers. Note that it's not immediately obvious that our new addition operation is associative.

Multiple sets of points allows choosing smaller keys, which enables faster computation.

Secret Sharing

Ref: Schneier 23.2

Problem: We want to store a secret in n places such that a quorum q of parties is necessary to recover it. E.g., missile silo launch scenario that requires 2 or more people to use their keys simultaneously to launch a missile.

Shamir's approach: Choose a qth-degree function

f(x) = xq + aq-1*xq-1 + ... + a0 mod p.

The unknowns are the ai's, and a0 is the secret value. Therefore, f(0) = secret = a0. We require that p is prime, p >> secret, and a1 through aq-1 are random.

To distribute the secret, give f(n) to person n. Now each person has one equation in q unknowns. Only by getting together all q equations do we have enough information to solve. (Lagrangian interpolation). The q equations are linearly independent (basic result from number theory) so we know that getting the set of q equations does yield enough information to solve.

An example of this technique's usefulness: computing the average salary of a group without anyone having to reveal his/her salary to the group.

Bad Approach 1: Alice chooses a random constant and adds it to her salary. She passes this value to Bob, who adds his salary and passes the sum to Charlie, and so on down the line. Then Alice subtracts the random constant and the total salary is known. Unfortunately, this can be broken if just two people collaborate (e.g., A & C can figure out B's salary).

Bad Approach 2: Everyone adds a random constant and passes the sum along. Then the number circulates a second time, with everyone subtracting off their random value. Again, two collaborators is enough to break this.

Successful Approach: Modify Shamir's method. Each person has their own equation (a0, b0, etc. are the secret salaries).

fA = xq + aq-1*xq-1 + ... + a0 mod p
fB = xq + bq-1*xq-1 + ... + b0 mod p
and so on.

If we add these up we get:

fsum = q*xq + (aq-1 + bq-1 + ... + zq-1)*xq-1 + ... + (a0 + b0 + ... + z0) mod p

and the last term is just what we want, the sum of all the salaries.

Now each person sends out values to all the others: A sends fA(1), fA(2), etc. B sends fB(1), fB(2), etc. Each person adds up all the values received, so that the nth person has fsum(n). Once again, if and only if all the participants get together, they have enough equations to solve for the coefficients in fsum.

Note: this also works for multiplication, and once we have + and * we can construct digital circuits for pretty much any operation.

Key Exchange

Suppose there are two parties that are interested in sharing a secret key. How can they agree on a key secretly, protected from eavesdroppers? The Diffie-Hellman method (Schneier 22.1), based on discrete logarithm, solves this problem by letting the parties exchange enough information to be able to compute the key, without actually exchanging the key. This works because computing discrete logs is hard -- like factoring. The method can be extended to more than 2 parties. Each one needs to receive n-1 exchanges to compute the secret key.

Remote Coin Flipping

Alice and Bob want to flip a coin fairly, communicating over the phone. How can they do this? (Compare mental chess to mental poker -- which one would YOU bet money on?)

The following method uses this property: All odd numbers are either of the form 4j+1 or 4j-1. If you choose two numbers of the same type and multiply them, you always get a product of the form 4j+1. So from looking at the product, you can't tell which type the factors were.

This method relies on the hardness of factoring, and the fact that there are an infinite number of both types of primes.

Major concerns about Protocols

Authentication

Authentication == proving your identity to another entity (person or computer). We want 2-way authentication, so that each party is sure of the other.

Standard, simple method: passwords or PINS. These are easy to forget, so when we use many passworded systems we typically build a small set of heavily re-used passwords. They are also easy to capture in transit (e.g. packet-sniffers, or the fake ATMs that take in a card, ask for the PIN, and then reject the card). Exhaustive search, cryptanalysis, and word-guessing also can yield passwords.

Biometrics (e.g. retinal scan, fingerprint) offers new means of authentication, but these methods aren't generally practical or comfortable for the user. It's still possible to inject data into the system further down the wire. Also, this makes people's body parts valuable.

We need a secure way to authenticate identity.

Challenge-Response Authentication

General idea: one party sends a message and the other responds to the message in a pre-agreed way that demonstrates identity. There is usually a time constraint as well; if the response arrives too slowly, the authentication is not successful.

Simple public-key version:

What's wrong with this? Bob now has a mechanism to get Alice to sign ANYTHING. The supposedly random challenge could be a document giving him all her money! Also, Alice is giving Bob information that she doesn't really want to: if Bob wants to figure out Alice's private key, he's got a way to conduct a chosen-plaintext attack.

Zero-Knowledge Authentication

We can avoid the problems above, using the same challenge-response model with a zero-knowledge method of demonstrating identity. The following conditions must be met (ref: Schneier 5.1, 5.2, 21.1): Example: Alice wants to prove that she has an algorithm for finding Hamiltonian paths, but she doesn't want to give away the algorithm. So, for a particular graph, such as
A *_          _* B
  | \_      _/
  |   \_  _/
  |     \/
  |    _/\_
  |  _/    \_
  | /        \
C *------------* D
here's what Alice and Bob do: This method is not very practical -- think how many envelopes it would take to get 2-40 certainty! But there's a better method based on Rabin.

Rabin Zero-Knowledge Authentication

This is a simplified version of Fiat-Feige-Shamir method. This doesn't leak information:
Bogus Alice will be caught 50% of the time: if bogus-A knows both (ar mod pq) and (r mod pq), she can perform modular division to get a.

As before, this is based on the belief that it's difficult to factor.

Zero-knowledge authentication is good as a key to unlock something once. It's not useful for setting up a channel for ongoing communication, as no session key has been exchanged. Also, it's open to attack if an intruder intercepts messages from Alice and replays them to Bob, and vice-versa. Then the intruder has authenticated to Alice as "Bob", and to Bob as "Alice".

Private Key Cryptography

Private-key cryptography, in which the communicating parties share a single secret key, is an old, old method. Julius Caesar was a famous early user of private-key systems (discussed in Gallic Wars). These break down into various types by the way they act on data. The only perfect cipher is a one-time pad. This is a randomly-generated key which is used only once and then discarded. The key may need to be very large (possibly the same size as the data, for example when the encryption & decryption consist of XOR'ing with the key).

Enigma

Enigma was a German rotor cipher. It's the basis of most published private key cryptosystems. It was cracked by an early version of differential cryptanalysis.

Book recommendations:

Enigma uses 3 rotors, which turn odometer-like after each character is encrypted, to produce a constantly-changing encryption key. Input character signals pass through all three rotors (transformed to another letter by each rotor), are reflected, and then pass back through the rotors. Decryption works the same way.

Data Encryption Standard (DES)

DES history:

DES criticisms and realities
56 bit key size is less secure than Lucifer's 128-bit key.
Bogus! NSA improved the algorithm and removed extra redundant bits.
By fiddling with the S-boxes, NSA made them less secure.
Bogus! They are more secure than random S-boxes.
16 rounds is not sufficient.
Bogus! It has been shown that more than 16 won't help.
Exhaustive attack will be feasible by 1985.
Got the date wrong, but otherwise correct. Recently a key was cracked using a collection of workstations. Special purpose machines should be practical soon -- NSA probably has some already.
Note that the FBI is still using 40-bit keys...

How to improve DES?

Encrypt with 2 keys (J,K), so that ciphertext c = EJ(EK(m)).
Unfortunately, the cost of cracking this is 257, not 2112 as might be expected. Here's why (The "Meet In The Middle" attack):

Given c & m for c = EJ(EK(m)),

Consider this in terms of the Birthday Paradox. There are 264 possible J's & K's. DES uses 256 of them. Thus 1/28 of the possible J's are used, and the same for K's. So 1/216 of the values are used as both J & K. This is 248 values. That's quite a lot to check, but it's still O(256).

Thus, the total cost is O(257).

This happens because DES is not a group, so EJ(EK(m)) != EJK(m). RSA, by comparison, *is* a group. (ne)e' = ne''.

Triple DES
If you encrypt 3 times, you get 2112 security.

Now encryption is c = EL(DJ(EK(m))). The second encryption is written as DJ (a decryption) for historical reasons.

You can generate (J,K,L) from two DES keys (X,Y), thus reducing the size of the overall key:

where T1, T2, T3 are constants.

Next time: differential cryptanalysis. Read 12.4, 3.3, 24.5.


Last modified: Tue Nov 11 16:15:48 EST 1997