PHPackages                             devixel/hmac-security - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. devixel/hmac-security

ActiveLibrary[Security](/categories/security)

devixel/hmac-security
=====================

HMAC Validator SDK

0.0.6(3y ago)120MITPHPPHP &gt;=7.0.0

Since Sep 12Pushed 3y ago2 watchersCompare

[ Source](https://github.com/rzlyp/hmac-signature)[ Packagist](https://packagist.org/packages/devixel/hmac-security)[ Docs](https://appliance.io/)[ RSS](/packages/devixel-hmac-security/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

hmac-signature
==============

[](#hmac-signature)

HMAC Signature validator for HTTP request based on the timestamp

How to Use ?
============

[](#how-to-use-)

```
composer require devixel/hmac-security
composer dump-autoload

```

How to use it?

Make Sure you're using the Etc/UTC Timezone for signature, so we don't need to think about the Timezone differences of the each client.

Matching HMAC Signature
=======================

[](#matching-hmac-signature)

```
use Carbon\Carbon;
use Devixel\HMAC;

$tolerance = 10;
$private_key = env("private_key_hmac");

$time = Carbon::now()->timezone('Etc/UTC')->timestamp;
$url = "login/test";
$request_payload = [
    "id" => 1,
    "name" => "Jon Doe",
    "address" => "113 Manchester Rd, St. Louis, MO, USA",
    "transaction_id" => "INV/3323/2022-666"
];
$request_payload = md5(json_encode($request_payload));
$request_method = "POST";
$payload = $request_method.":".$url.":". $request_payload.":".$private_key.":".$time;

$signature =  hash_hmac('sha256', $payload, $private_key);

$args = [
    "request_method" => $request_method,
    "url" => $url,
    "request_payload" => $request_payload,
    "private_key" => $private_key
];

$separator = ":";

/**
     * @tolerance - Max tolerance for hmac signature
     * @signature - Signature that sended from the other side
     * @private_key - Access token that you used to generate the HMAC Encryption
     * @separator - Separator that you used to create the HMAC payload
     * @args - Argument or payload that you want to used such as ["email" => "test@mail.com", "time" => "90239303234"]
     *
*/

$hmac_match = HMAC::matchingHmac($tolerance, $signature, $private_key, $separator,  $args);

if($hmac_match){
      //matching the signature success
}else{
  //some actions
}
```

Time Validate
=============

[](#time-validate)

```
use Carbon\Carbon;
use Devixel\HMAC;

$time = time(); //client request timestamp
$tolerance = 10; //you can add the tolerance of each request due the latency problem, Default to 0 second

$validate_time = HMAC::validSignatureTime($time, $tolerance);
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

1389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea133ac9e5127c97fd57325b7216d9dbaec7d5a743ea98ddedbf2ed57d084323?d=identicon)[rzlyp](/maintainers/rzlyp)

---

Top Contributors

[![faisalishak](https://avatars.githubusercontent.com/u/11269478?v=4)](https://github.com/faisalishak "faisalishak (4 commits)")[![rzlyp](https://avatars.githubusercontent.com/u/15766716?v=4)](https://github.com/rzlyp "rzlyp (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devixel-hmac-security/health.svg)

```
[![Health](https://phpackages.com/badges/devixel-hmac-security/health.svg)](https://phpackages.com/packages/devixel-hmac-security)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M305](/packages/laravel-horizon)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10244.2k5](/packages/bitrix24-b24phpsdk)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
