PureBasic Shamir Secret Sharing is an open-source, self-contained and educational implementation of the Shamir Secret Sharing Scheme, written entirely in PureBasic.
Shamir Secret Sharing is a cryptographic method that splits a secret into multiple parts (shares), such that any combination of at least T shares can reconstruct the original secret, while any number of shares fewer than T reveals no usable information.
This implementation operates over the finite field GF(257), allowing correct handling of all byte values (0–255) without loss, making it compatible with any type of string or binary-compatible data.
Main Features
Complete implementation of Shamir Secret Sharing
Arithmetic over GF(257)
Compatible with all character strings
Robust Lagrange interpolation
Safe modular inverse computation
Shares encoded in hexadecimal (3 characters per byte)
Clear, well-commented source code
⚠️ Disclaimer
This project is intended for educational and demonstration
Features
- Split a secret into N shares
- Configurable reconstruction threshold T
- Reconstruct the secret from any valid set of T shares
- No information leakage with fewer than T shares
- Secure modular arithmetic
- Fully working example included