Download the PHP package rasalas/easycrypt without Composer
On this page you can find all versions of the php package rasalas/easycrypt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rasalas/easycrypt
More information about rasalas/easycrypt
Files in rasalas/easycrypt
Package easycrypt
Short Description turns array data or strings in url safe(optional) signed crypt strings and can decrypt them again and make sure it's the same data
License MIT
Informations about the package easycrypt
EasyCrypt
EasyCrypt helps to easily encrypt data with a simple passphrase.
What is it for?
It encrypts array data or strings that you might want to append to your URL as GET data. Or maybe you want to put it in a hidden input. All yours to decide.
If someone tampered with the data, you'll notice, as it's going to return false
instead of with data (this might change). That's also what's the $salt
is for. EasyCrypt signs the data and checks if the data is still unchanged.
Please DO NOT use this to store user data or other sensitive data.
Installation
Example usage
crypt (216 bytes)
P9P9WtCGQYQu+Isn7uO0HAMx4Cg+NcFKGmB5Abg4vJD00+PQXmEvHBvycapbOLKZOYnHw0L2Omv/61/6NLWJbQKfjQLXlPykGWiTjwGpz1LD0pZTJla8euIbJHhFiu5RByqeF8Dh40I25Nwh3vGBdIbgffqgT8qIkbIqFQrif8BTzFy1mcLa5so/hWcyUx6T9d8Wrw7l7ifIL2MzReS0hA==
Output
URL safe usage
If you want to use it in URLs or as html-input value, you probably dislike characters like /
. So just use the URL_SAFE
constant, (true
and 1
, should work too, but stick to the former).
This makes the crypt strings longer. So pick what's best.
::decrypt()
can decrypt an url safe crypt without the URL_SAFE
parameter, but has to try to decrypt the data first; so give it a break and use it. 😉
crypt (288 bytes, 33% bigger)
UDlQOVd0Q0dRWVF1K0lzbjd1TzBIQU14NENnK05jRktHbUI1QWJnNHZKRDAwK1BRWG1FdkhCdnljYXBiT0xLWk9Zbkh3MEwyT212LzYxLzZOTFdKYlFLZmpRTFhsUHlrR1dpVGp3R3B6MUxEMHBaVEpsYThldUliSkhoRml1NVJCeXFlRjhEaDQwSTI1TndoM3ZHQmRJYmdmZnFnVDhxSWtiSXFGUXJpZjhCVHpGeTFtY0xhNXNvL2hXY3lVeDZUOWQ4V3J3N2w3aWZJTDJNelJlUzBoQT09