A very simple and safe PHP library that provides methods to handle HMAC in applications.

1.0.3 2023-09-06 12:42 UTC

This package is auto-updated.

Last update: 2024-05-06 14:16:32 UTC


README

A very simple and safe PHP library that provides methods to handle HMAC in applications.

Getting started

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();

Create Secret Key

$secretKey = $hmac->createSecret(1000, true, true);

Create Signature

$message = "Hello!, I am creating a Signature with the HMAC Class";

$createdSignature = $hmac->createSignature("sha256", $message, $secretKey, true, true);

Verify Signature

$signatureVerificationResult = $hmac->verifySignature($createdSignature, $userSuppliedSignature);

echo "verification result: <br>";
var_dump($signatureVerificationResult);

License

This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.