PHPackages                             carry0987/hash - 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. carry0987/hash

ActiveLibrary[Security](/categories/security)

carry0987/hash
==============

PHP-Hash is a comprehensive library designed to facilitate the generation of securely encrypted URLs.

1.1.0(2y ago)0442MITPHPPHP &gt;=7.4

Since Mar 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/carry0987/PHP-Hash)[ Packagist](https://packagist.org/packages/carry0987/hash)[ RSS](/packages/carry0987-hash/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (2)

PHP-Hash
========

[](#php-hash)

[![Packgist](https://camo.githubusercontent.com/a445ca31dc59cd83cced809b5108f30e18392a1c7086ded4c9eca77ed7028b79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361727279303938372f686173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carry0987/hash)
PHP-Hash is a comprehensive library designed to facilitate the generation of securely encrypted URLs. With support for customizable encryption algorithms and AEAD (Authenticated Encryption with Additional Data) cipher modes, it offers flexibility while ensuring the integrity and authenticity of the data.

Features
--------

[](#features)

- Easy generation of encrypted URLs.
- Support for a variety of encryption algorithms and AEAD cipher modes.
- Customizable prefixes, suffixes, and path formatting for encrypted URLs.
- Integration with the Composer package manager for straightforward installation.

Installation
------------

[](#installation)

Use Composer to install PHP-Hash in your project:

```
composer require carry0987/hash
```

Usage
-----

[](#usage)

To use PHP-Hash to generate encrypted URLs, follow these steps:

1. **Initialization**:

```
use carry0987\Hash\Hash;

// Initialize with your signature key and signature salt
$hash = new Hash('your_hex_signature_key', 'your_hex_signature_salt');
```

2. **Configuration** (Optional): Customize encryption settings as needed.

```
// Set a custom encryption cipher
$hash->setCipher('aes-256-gcm');

// Set a custom encryption algorithm for generating binary signatures
$hash->setEncryptAlgorithm('sha256');

// Optionally, set a custom Additional Authenticated Data (AAD) for AEAD ciphers
$hash->setAAD('your_custom_aad');

// Customize the encrypted path's prefix and suffix
$hash->setPrefix('/custom-prefix');
$hash->setSuffix('/custom-suffix');
```

3. **Generate Encrypted URL**:

```
$originalUrl = 'https://yourdomain.com/original/path';
$encryptedUrl = $hash->generateEncryptedUrl($originalUrl);
echo $encryptedUrl;
```

Custom Path Formatting
----------------------

[](#custom-path-formatting)

PHP-Hash allows for custom formatting of the encrypted path through a user-defined callback function:

```
$hash->setPathFormatter(function ($encryptedUrl, $options) {
    // Your custom logic here
    return "/custom/format/$encryptedUrl";
});
```

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

4

Last Release

788d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f43bad259478092c4ff269518aa9a0c8e91a537a67272877041b4bc1f25cfe8?d=identicon)[carry0987](/maintainers/carry0987)

---

Top Contributors

[![carry0987](https://avatars.githubusercontent.com/u/12984973?v=4)](https://github.com/carry0987 "carry0987 (12 commits)")

---

Tags

hashphp

### Embed Badge

![Health badge](/badges/carry0987-hash/health.svg)

```
[![Health](https://phpackages.com/badges/carry0987-hash/health.svg)](https://phpackages.com/packages/carry0987-hash)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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