B.10 Examples for Chapter 17

Example 38

Suppose we have a (5, 8) Shamir secret sharing scheme. Everything is mod the prime p=987541. Five of the shares are

(9853, 853), (4421, 4387), (6543, 1234), (93293, 78428), (12398, 7563).

Find the secret.

SOLUTION

One way: First, find the Lagrange interpolating polynomial through the five points:

> interp([9853,4421,6543,93293,12398],
[853,4387,1234,78428,7563],x)
49590037201346405337547133788641510994876594882226797600000X4+3531308571691925577790733078919242767399658439658815119840000X3882962897832113977107683736148119112663072999268084983175256800000X2+974904923047445071695080351981108144596213836998292198294075599200000X+20448432615404498323011459243394428259122298106918499146099147037799600000

Now evaluate at x=0 to find the constant term:

> eval(%,x=0)
20448432615404498323011459243394428259122298106918499146099147037799600000

We need to change this to an integer mod 987541:

> % mod 987541

                   678987

Therefore, 678987 is the secret.

Here is another way. Set up the matrix equations as in the text and then solve for the coefficients of the polynomial mod 987541:

> map(x->x mod 987541,evalm(inverse(matrix(5,5,
[1,9853,9853aˆ2,9853aˆ3,9853aˆ4,
1,4421,4421aˆ2,4421aˆ3,4421aˆ4,
1,6543,6543aˆ2,6543aˆ3, 6543aˆ4,
1, 93293, 93293aˆ2,93293aˆ3, 93293aˆ4,
1, 12398, 12398aˆ2,12398aˆ3,12398aˆ4]))
&*matrix(5,1,[853,4387,1234,78428,7563])))
[678987147281651574413456741]

The constant term is 678987,  which is the secret.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset