A very simple and safe PHP library that provides methods to handle HMAC in applications.
With Composer, run
composer require easeappphp/hmac:^1.0.3
Note that the vendor
folder and the vendor/autoload.php
script are generated by Composer; they are not part of PDOLight.
To include the library,
<?php
require 'vendor/autoload.php';
use \EaseAppPHP\Hmac\Hmac;
$hmac = new Hmac();
$secretKey = $hmac->createSecret(1000, true, true);
$message = "Hello!, I am creating a Signature with the HMAC Class";
$createdSignature = $hmac->createSignature("sha256", $message, $secretKey, true, true);
$signatureVerificationResult = $hmac->verifySignature($createdSignature, $userSuppliedSignature);
echo "verification result: <br>";
var_dump($signatureVerificationResult);
This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.