ronakiihglobal/stringcrypto

encrypt decrypt id/string with ease

Maintainers

Package info

github.com/ronakiihglobal/stringcrypto

pkg:composer/ronakiihglobal/stringcrypto

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2021-05-23 09:20 UTC

This package is not auto-updated.

Last update: 2026-03-09 07:27:27 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);