PHP code example of teqneers / shamir
1. Go to this page and download the library: Download teqneers/shamir library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
teqneers / shamir example snippets
#!/usr/bin/env php
$shares = Secret::share('Shamir\'s Shared Secret Implementation in PHP', 5, 2);
var_dump($shares);
var_dump(Secret::recover(array_slice($shares, 0, 2)));
var_dump(Secret::recover(array_slice($shares, 1, 3)));