Simple compact encrypter
composer require tigr/compact-encrypter
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.
- 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.