Skip to content

Data encrypter producing compact and URL-safe output

License

Notifications You must be signed in to change notification settings

TiGR/compact-encrypter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL-safe Compact Encrypter

Travis (.org) PHP from Packagist Packagist Version GitHub

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?

  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.

About

Data encrypter producing compact and URL-safe output

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages