Home
Writeups Misc About
Armory

Armory

This is about Shamir's secret sharing scheme, where the main idea is based on having sufficient points to fully define a polynomial curve. A polynomial of degree t1 can only be constructed if t points (shares) are known.

In this challenge, only the first share is known, so it seems like we do not have any way of retrieving the value. However, we can observe two points:

Hence, as we are given minimum=3, the polynomial is of degree 2. The form of the polynomial is thus c2x2+c1x+s, where s is the unknown secret. We have the coordinate of a point, which is (c1,y), where y is the second number obtained from the single share.

The secret s can thus be derived from s=yc2c12+c1c1. Note that all operations are done under the prime modulo given, but for the sake of typing is omitted.

Python Implementation: