ronakiihglobal / stringcrypto
encrypt decrypt id/string with ease
v1.0.1
2021-05-23 09:20 UTC
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-07 09:56:49 UTC
README
This is simple package for encrypt/decrypt small strings like database IDs with ease. It is based on openssl_encrypt.
The encrypt method used is AES-256-CBC.
Usage
composer require ronakiihglobal/stringcrypto
then
require_once __DIR__ . '/vendor/autoload.php';
use ronakiihglobal\stringcrypto\Crypto;
$crypto = new Crypto("testkey","testIv"); these values should be random string of length 16 and should be managed as secret in env variables.
$encrypted = $crypto::encrypt("123"); this value should be string.
$decrypted = $crypto::decrypt($encrypted);