PHP code example of ionux / phactor

1. Go to this page and download the library: Download ionux/phactor 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/ */

    

ionux / phactor example snippets


php composer.phar 

$key = new \Phactor\Key;

$info = $key->GenerateKeypair();

$sig = new \Phactor\Signature;

$signature = $sig->generate('my message to sign...', $info['private_key_hex']);

$sig = new \Phactor\Signature;

if ($sig->Verify($signature, $message, $publickey) == false) {
  // The signature is invalid - reject!
} else {
  // The signature is valid.
}

$sin = new \Phactor\Sin;

print_r($sin->Generate($info['public_key_compressed']));