zqhong/encrypter
Encrypter - A powerful encrypter library based on illuminate/encryption
The encryption algorithms that Encrypter supports:
- AES-128-CFB
- AES-192-CFB
- AES-256-CFB
- RC4
- RC4-MD5
Simple
<?php
require __DIR__ . "/vendor/autoload.php";
use Zqhong\Encrypter\Encrypter;
$key = 'password';
$cipher = 'RC4-MD5';
$plainText = 'hello world';
$encrypter = new Encrypter($key, $cipher);
$payload = $encrypter->encryptString($plainText);
echo $payload . PHP_EOL;
echo $encrypter->decryptString($payload) . PHP_EOL;
// will output
//eyJpdiI6IiIsInZhbHVlIjoiMDIxR1dXcHg4K21yR2RBPSIsIm1hYyI6ImRhYzFjYWFjODg5ODA1MWFlMWE0OTZmYTNjMTlkYWIxNDExZjAzYzU2ZjlhM2FmMTY1ZWYwYjFkYTJiZjJkNjgifQ==
//hello world
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
644,549,754
9,698
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
423,477,751
607
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
399,241,428
4,660
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v1.1 | >=5.4.0 | MIT | |
| v1.0 | >=5.4.0 | MIT |