PHPackages                             tigr/compact-encrypter - 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. tigr/compact-encrypter

ActiveLibrary[Security](/categories/security)

tigr/compact-encrypter
======================

Data encrypter producing compact and URL-safe output

1.0.0(2y ago)0151MITPHPPHP ^7.4|^8.0

Since May 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/TiGR/compact-encrypter)[ Packagist](https://packagist.org/packages/tigr/compact-encrypter)[ RSS](/packages/tigr-compact-encrypter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

URL-safe Compact Encrypter
==========================

[](#url-safe-compact-encrypter)

[![Travis (.org)](https://camo.githubusercontent.com/ac0a90802f8cda0ac5c35d4cff5ec8f7774690da5a26ecab85d0a65d3358bf44/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f546947522f636f6d706163742d656e637279707465722e737667)](https://camo.githubusercontent.com/ac0a90802f8cda0ac5c35d4cff5ec8f7774690da5a26ecab85d0a65d3358bf44/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f546947522f636f6d706163742d656e637279707465722e737667)[![PHP from Packagist](https://camo.githubusercontent.com/248632894d9d27a25ffd8e154ef857059e7aedef81ab34c3a5b19fd6a912d3a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c75652e737667)](https://camo.githubusercontent.com/248632894d9d27a25ffd8e154ef857059e7aedef81ab34c3a5b19fd6a912d3a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c75652e737667)[![Packagist Version](https://camo.githubusercontent.com/dd499ce55585dd5f36885be0c82e22da468c76ebcafe92efab57b76b366f2359/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f546947522f636f6d706163742d656e637279707465722e737667)](https://camo.githubusercontent.com/dd499ce55585dd5f36885be0c82e22da468c76ebcafe92efab57b76b366f2359/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f546947522f636f6d706163742d656e637279707465722e737667)[![GitHub](https://camo.githubusercontent.com/c21b89eb7acfa715ca8c7946f4ede82ead87044c6676f2de441ef7ba8b29f3e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f546947522f636f6d706163742d656e637279707465722e737667)](https://camo.githubusercontent.com/c21b89eb7acfa715ca8c7946f4ede82ead87044c6676f2de441ef7ba8b29f3e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f546947522f636f6d706163742d656e637279707465722e737667)

Simple compact encrypter

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

[](#installation)

```
composer require tigr/compact-encrypter

```

Why?
----

[](#why)

It provides very concise encrypted URL-safe data. For instance, it could be used to create self-contained tokens that would contain all the necessary information inside.

How does it work?
-----------------

[](#how-does-it-work)

1. No intermediate base64 or hex encoding, all data is raw binary.
2. No JSON, use pack()/unpack().
3. Use URL-safe version of base64 (drop trailing '=', replace '/+' with '-\_').
4. For hashing, use SHA1 instead of SHA256. I know, I know, but for real-world purposes SHA1 is still good enough.
5. Allow dropping Mac (validation hash) whatsoever if you want it really short.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

1080d ago

### Community

---

Top Contributors

[![TiGR](https://avatars.githubusercontent.com/u/281226?v=4)](https://github.com/TiGR "TiGR (2 commits)")

### Embed Badge

![Health badge](/badges/tigr-compact-encrypter/health.svg)

```
[![Health](https://phpackages.com/badges/tigr-compact-encrypter/health.svg)](https://phpackages.com/packages/tigr-compact-encrypter)
```

###  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)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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