From Adi Shamir's How to Share a Secret, referenced from his paper and the Wikipedia entry, using finite field arithmetic.
- No
npm installnecessary! All in native JS! - Modify test.js values
S,N, andP(if you dare) with desired values. - Run
node test.js, and it will reconstruct your secret! - Most importantly: have fun. I sure did!
N(orK) has an unspecified limit. Anything above will be insufficient to return the secret.