orz14/crypt-php

Simple AES-256-CBC encryption and decryption class for PHP.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/orz14/crypt-php

v1.0.0 2025-10-06 13:17 UTC

This package is auto-updated.

Last update: 2025-10-06 13:22:46 UTC


README

Simple AES-256-CBC encryption and decryption class for PHP.

Installation

You can install the package via Composer.

composer require orz14/crypt-php

Usage

Make sure the CROSS_ENCRYPTION_KEY environment variable is set and contains a base64-encoded key (32 bytes before encoding).

# generate key example
php -r "echo base64_encode(random_bytes(32)) . PHP_EOL;"
use Orz14\Crypt;

// Encryption
$cipher = Crypt::encrypt('hello world');
echo $cipher; // D5kvEf5S4MAKdLNcTbZdWkMGmI34vQt+LOdP4iU7C+w=

// Decryption
$plain = Crypt::decrypt($cipher);
echo $plain; // hello world

Changelog

Please see the GitHub "Releases" page for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.