Skip to Content
oxcrypto

Shamir

Shamir secret sharing of byte strings over GF(256).

from oxcrypto.secret_sharing.shamir import SHAMIR

shares = SHAMIR.GF256.split(b"secret", threshold=3, shares=5)
assert SHAMIR.GF256.combine(shares[1:4]) == b"secret"

SHAMIR.GF256 shares each byte of a non-empty secret with its own random polynomial over GF(2^8) (AES polynomial). Each share is one identifier byte followed by one byte per secret byte, so at most 255 shares exist. Shares give no integrity check; use Feldman or Pedersen when shareholders must verify their shares.

StandardShamir, "How to Share a Secret" (1979); not standardized
Cratevsss-rs 6.0.1, stable
AuditNo published audit
MSRVBuilds with the project MSRV 1.88
ExperimentalNo
Test vectorsNone published; tests recover the secret from every threshold subset