Skip to content

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

License

Notifications You must be signed in to change notification settings

easeappphp/Hmac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMAC

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages