1 of 32

Shamir Knows Alice and Bob's Shared Secret

a brief introduction to secret sharing

Thom Dixon <thomdixon@ufl.edu>

a brief introduction to secret sharing

2 of 32

First...

3 of 32

Contrived motivation

  • The scrupulous bank manager.
    • Has eight employees under her.
    • Wants the vault to only be opened when more than half of her employees are present.
  • How can she do this?
  • Let's generalize the problem a little, and then reconsider.

4 of 32

Once again, with precision

  • Given a secret S, we wish to give n people shares (pieces derived from S) such that:
    • Knowing k (where k is bounded above by n) many shares enables you to reconstruct S.
    • Having only k-1 (or less) shares gives you no further information about S.
  • This is called an (n, k)-threshold scheme, where k is the threshold. The dealer provides the shares to the players.

5 of 32

Shamir's clever idea

  • To solve our flustered bank manager's problem, we're going to construct an

(n, k)-threshold scheme.

  • Recall that a kth degree polynomial can be determined given k+1 points along the curve (interpolation).
  • The gist is to encode our secret as a coefficient of a polynomial P with degree k-1, and then dole out the results of evaluating P at various points.

6 of 32

Shamir Secret Sharing

  • Represent S uniquely as a natural.
  • Choose a prime q such that q > S.
  • Construct a (k-1)th degree polynomial P over GF(q) in the following way:
    • Fix the constant term a0 = S.
    • Randomly choose the remaining k-1 coefficients a1, ..., ak-1 from GF(q).
    • For i = 1, ..., n, hand out (i, P(i)) as shares.

7 of 32

Consequences

  • This is very clearly an (n, k)-threshold scheme.
  • Why do this over GF(q)? Convenience.
  • This scheme is information-theoretically secure (like One-Time Pad). In a nutshell, given an infinite amount of time and (computational) resources, this scheme remains impervious to cryptanalysis.
  • This scheme is minimal (each share does not exceed the order of the secret).

8 of 32

Consequences (cont'd.)

  • This scheme is hierarchical.
    • Remember our bank manager? Construct an (18, 6)-scheme. The manager gets six shares, her two assistant managers get three each and each employee gets one share.
  • Although minimal, this scheme does require that given a one gigabyte secret, each share be roughly one gigabyte.

9 of 32

Applications

  • Distributed voting protocol.
    • Note that Shamir's scheme is homomorphic with respect to the encoding function f, of the secret. That is, denote by W the set of all secrets, then f : W → GF(q)[x] is a homomorphism under addition. In particular, given encoded secrets a, b ∈ GF(q)[x] we have that f -1(a + b) = f -1(a) + f -1(b).

10 of 32

Applications (cont'd.)

  • Assume we're voting on a yes or no issue.
  • Suppose that there are n polling authorities and each has a published public identification number vi.
  • Each voter will construct a (n-1)-degree polynomial Pj using Shamir's scheme with their secret being -1 (no) or 1 (yes).
  • Then the voter will evaluate Pj(vi ) for i = 1, ..., n and give this value to polling authority i.

11 of 32

Applications (cont'd.)

  • Finally, the polling authority i will sum all of the Pj(vi ) values provided by voters and distribute this sum to the other n-1 authorities.
  • Given all n sums, we can interpolate using the points (vi , ∑ Pj(vi )).
  • The resulting constant term is positive if more votes were received for yes and negative if more votes were received for no.

12 of 32

Relax a little

  • By relaxing the condition of information-theoretic security (i.e., perfect security) for computational security we can get smaller shares, and therefore a more practical scheme.
  • This forms the foundation for a 1993 paper titled Secret Sharing Made Short from Hugo Krawczyk at IBM.
  • Let's cover some prerequisites.

13 of 32

Semantic security

  • Denote by EncK the (private key, length-preserving) encryption function Enc selected by key K. Let M be a message in the domain of EncK. We say that EncK is semantically secure if no information about M can be obtained in polynomial time from EncK(M).

14 of 32

Semantic security (cont'd.)

  • This is equivalent to and often stated in the (easier to phrase/understand) form of ciphertext indistinguishability.
  • An encryption function has ciphertext indistinguishability if an adversary who possesses two plaintexts M and M' and their respective ciphertexts C and C', has probability 1/2 + ε(K) of matching them correctly.

15 of 32

Reed-Solomon codes

  • Very similar to Shamir's scheme.
  • Rather than a secret S, we have data D.
  • Instead of letting D be the constant term, we partition D in a natural way into D0, ..., Dk-1 and let these be the coefficients of a (k-1)th degree polynomial P over GF(q) with q a sufficiently large prime.
  • We then evaluate P at i = 1, ..., n and dole out (i, P(i)).
  • Reconstruct D easily via interpolation.

16 of 32

Krawczyk's clever twist

  • Let S denote our secret and let Enc be a semantically secure cipher.
  • Randomly select a key K and define E := EncK(S).
  • Partition E into n fragments, E1, ..., En, using Reed-Solomon.
  • Use Shamir's scheme to construct n shares of K, dubbed K1, ..., Kn.
  • Dole out (Ei, Ki) for i = 1, ..., n as shares.

17 of 32

Consequences

  • Is computationally secure. That is, if an adversary is given k-1 shares, they cannot discern further information about S in polynomial time.
  • Reconstruction is very simple (interpolate twice, and then decrypt).
  • Each share is roughly |S|/n + |K| units in size.

18 of 32

Applications

  • More or less the idea behind the Vanish project from the University of Washington, which seeks to provide self-destructing data in a peer-to-peer system.
  • Unfortunately, their replication algorithm was too eager which left them vulnerable to a Sybil attack, but apparently they're working with Vuze to address the problem.

19 of 32

AONTs

  • In 1997, Ron Rivest (of RSA fame) introduced the concept of an All Or Nothing Transform (AONT).
  • Described by Victor Boyoko, an AONT is "an unkeyed, invertible, randomized transformation with the property that it is hard to invert unless all of the output is known."
  • In other words, an AONT is an (n, n)- threshold scheme.

20 of 32

AONTs (cont'd.)

  • In practice, AONTs are used as a preprocessing step prior to encryption, mapping a message to a pseudo-message. This requires that an adversary decrypt the entire ciphertext when trying possible keys, which can significantly increase their computation time.
  • We're going to explore Rivest's Package Transform, but first we have to cover some prerequisite knowledge.

21 of 32

XOR

  • Interpret length n bit vectors a, b, and c as elements of (2)n.
  • Then XOR (denoted by ⊕) is just the usual addition in this abelian group. That is,
    • a a = 0,
    • if a b = c then c b = a.
  • This last property lends to its heavy use in cryptography to combine keystreams with plaintext in order to produce ciphertext. That, and it's fast and cheap.

22 of 32

Block Ciphers

  • A block cipher is an indexed family of permutations which map a length n bit vector (called a block) to another length n bit vector in a pseudorandom fashion.
  • The secret key then selects a permutation from this family.
  • Common block ciphers include the AES (current FIPS), DES (old FIPS), 3DES, Blowfish, and more.
  • Wikipedia is a wonderful resource.

23 of 32

Hash Functions

  • Usually explained as a "fingerprint for data" since it provides integrity.
  • Is a function h which compresses an arbitrary length bit vector into an n length bit vector, where n is fixed.
  • h is a secure hash function if it
    • has first and second preimage resistance,
    • and has collision resistance.
  • Examples include MD5, SHA-1, Skein and Keccak (SHA-3).

24 of 32

Package Transform

  • Let Enc denote a block cipher and m1, ..., mn be our input message.
  • Choose a random key K for Enc and a fixed key L.
  • Compute the pseudo-message sequence c1, ..., cn+1 as follows.
    • ci = mi EncK(i) for i = 1, ..., n
    • cn+1 = K h(1) h(2) ... h(n)
      • where h(i) = EncL(ci i)

25 of 32

Considerations

  • The block cipher's block size provides a natural choice of share sizes.
  • Loophole in cryptography export restrictions permit use of strong AONTs with weak encryption. This was the primary reason the scheme was proposed.
    • This stems from the fact that K is not a shared secret key. It can be reconstructed by anyone who has the whole pseudo-message.

26 of 32

Applications

  • Useful as a mode of encryption (as previously discussed).
  • Use with Reed-Solomon to create an (n, k)-threshold scheme, as suggested by Resch and Plank in 2011 (dubbed AONT-RS).
  • Turns out that the OAEP (the padding used for RSA, as specified by PKCS #1) is an AONT, as shown by Ron Rivest's graduate student Victor Boyko in 1999.

27 of 32

Asmuth-Bloom Scheme

  • The big idea is to make an (n, k)-threshold scheme by constructing a system of n congruences such that the solution to any k of them uniquely determines S.
  • Choose pairwise coprime positive integers T, m1, m2, ..., mn such that
    • S < T < m1< ··· < mn and so that
    • m1m2 ··· mk > T · mn-k+2 ··· mn.
  • Such a sequence of integers is called an Asmuth-Bloom sequence.

28 of 32

Asmuth-Bloom (cont'd.)

  • Define M := m1m2 ··· mk for convenience.
  • Choose a random positive integer R such that y := S + RT < M.
  • Compute yi := y (mod mi) for i = 1, ..., n.
  • Dole out (yi , mi) as shares.
  • To see why this works, let D be a collection of k shares. Then by the CRT, there exists a unique solution y0 modulo MD := Πi D mi .

29 of 32

Asmuth-Bloom (cont'd.)

  • Since y < M < MD+1, we have that y0 is unique modulo M.
  • Finally, by construction, we have that S = y0 (mod T).
  • The key observation is that for any solution, y0, to a (k-1)-subset of congruences, y0 , can take on T possible values modulo T (i.e., is undetermined).

30 of 32

Consequences & Applications

  • Like Shamir's scheme, Asmuth-Bloom offers information-theoretic security.
  • This scheme was used to construct two function sharing schemes (replace the idea of reconstructing a secret with idea of evaluating a function) for computing RSA signatures and ElGamal decryption.

31 of 32

Other schemes

  • Blakely independently discovered secret sharing in 1979 (same year as Shamir). His scheme used the intersection of (n-1)-dimensional hyperplanes in n-dimensional space. Shamir's scheme won due to the use of less storage space.
  • There are a few other schemes based on the CRT. Wikipedia has a nice article.
  • Current research is looking into (public) verifiability, and proactivity.

32 of 32

Questions/Comments?

Slides available at thomdixon.org.