tigr / compact-encrypter
Data encrypter producing compact and URL-safe output
Installs: 15
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tigr/compact-encrypter
Requires
- php: ^7.4|^8.0
- ext-json: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ^8.1
This package is auto-updated.
Last update: 2025-09-29 02:59:36 UTC
README
Simple compact encrypter
Installation
composer require tigr/compact-encrypter
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?
- No intermediate base64 or hex encoding, all data is raw binary.
- No JSON, use pack()/unpack().
- Use URL-safe version of base64 (drop trailing '=', replace '/+' with '-_').
- For hashing, use SHA1 instead of SHA256. I know, I know, but for real-world purposes SHA1 is still good enough.
- Allow dropping Mac (validation hash) whatsoever if you want it really short.