2017 © Pedro Peláez
 

library taplink-php

PHP Bindings for Blind Hashing

image

taplink/taplink-php

PHP Bindings for Blind Hashing

  • Wednesday, January 11, 2017
  • by bradberger
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status codecov, (*1)

PHP Bindings for Blind Hashing

Installation

If you're using composer:, (*2)

composer require taplink/taplink-php

Otherwise, include the src/TapLink/TapLink/Client.php and src/TapLink/TapLink/Response.php files., (*3)

Usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

use \TapLink\TapLink\Client;

$appId = "my-app-id";
$taplink = new Client($appId);

$hash = hash_hmac(Client::$hashAlgorithm, "secret", hex2bin("4cb78a1a60599df9c3bd9e4ac741a5f15feec1812b22a5f15bbad978039f2765f00dd82d97272eb3674cd164a0cc7024bbfd3704c6df6e2cb17a6562bd96ecb7"));
$res = $taplink->getSalt($hash);
if ($res->err) {
    echo "An error occurred: ".$res->err;
    return;
}

echo "===================================\n";
echo "Version: {$res->versionId}\n";
echo "New version id: {$res->newVersionId}\n";
echo "Salt2Hex: {$res->salt2Hex}\n";
echo "New Salt2Hex: {$res->newSalt2Hex}\n";
echo "===================================\n";

$res = $taplink->newPassword($hash);
if ($res->err) {
    echo "An error occurred: ".$res->err;
    return;
}

echo "Version: {$res->versionId}\n";
echo "Salt2Hex: {$res->salt2Hex}\n";
echo "Hash2Hex: {$res->hash2Hex}\n";
echo "New version id: {$res->newVersionId}\n";
echo "New Salt2Hex: {$res->newSalt2Hex}\n";
echo "===================================\n";

$res = $taplink->verifyPassword($hash, "expected-hash");
if ($res->err) {
    echo "An error occurred: ".$res->err;
    return;
}
echo sprintf("Match: %s\n", $res->matched ? "true" : "false");
echo "Version: {$res->versionId}\n";
echo "Salt2Hex: {$res->salt2Hex}\n";
echo "Hash2Hex: {$res->hash2Hex}\n";
echo "New version id: {$res->newVersionId}\n";
echo "New Salt2Hex: {$res->newSalt2Hex}\n";
echo "===================================\n";

The Versions

11/01 2017

dev-master

9999999-dev

PHP Bindings for Blind Hashing

  Sources   Download

MIT

The Development Requires

by Jeremy Spilman

hash hashing salt blind taplink