Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

src/shamir.cc File Reference


Detailed Description

Definition for Shamir secret sharing (SSS) scheme.

Based on "How to Share a Secret", by Adi Shamir, Communications of the ACM, November, 1979, Volume 22, Number 11, page 612.

SSS provides a perfect $(t,n)$-threshold secret sharing scheme. i.e. it is a method for $n$ parties to carry shares $s_i$ of a secret s such that any $t$ of them are needed to recover the secret, but so that no $t-1$ of them can do so. The threshold is perfect if knowledge of $t-1$ or fewer shares provides no information regarding $s$. Shamir $(t,n)$-threshold scheme is based on classical Lagrange polynomial interpolation of degree $t-1$ with modular arithmetic instead of real arithmetic. The set of integers modulo a prime number 'prime' forms a field in which interpolation is possible. We choose to break the key in byte unit handled separately. The prime number has to be bigger than the largest number than can be represented (i.e. 0xff) and the number of shares n. In order to handle all byte values (0x00-0xff) and so that we can multiply two such numbers, the shared secrets will fit in a 16-bits integer (unsigned short). The prime has to be less than $2^16$ in order to fit them all. The largest such prime is 65521.

test-shamir.cc This is an simple split/join test for Shamir secret sharing scheme.

#include <crypt.h>

Namespaces

namespace  glite


Generated on Thu May 11 18:54:33 2006 for Glite Security encrypted storage cpp by doxygen 1.3.5