Home > Coding > PHP: Shamir’s Secret Sharing Class

PHP: Shamir’s Secret Sharing Class

August 19th, 2010

Having searched on google I wasn’t able to find a PHP implementation of Shamir’s secret sharing, I was only able to find a perl implementation.

So for anyone else who’s after the same thing I’ve created a (simple) PHP class which implements Shamir’s secret sharing which you can download below, it’s strongly based on the perl implementation above and is also licensed under the GNU GPL.

(It’s missing some error-condition checks in the ::recover() method.)

There’s a simple test case in the class file which’ll explain its usage.

[Download Shamir’s Secret Sharing class]

Coding , , ,

  1. | #1

    Thanks for your php implementation of Shamir’s Secret Sharing.

  2. Senthil
    | #2

    It’s awesome…It works fine even for big integers… Thank you so much…

  1. No trackbacks yet.