felixdorn/php-rc4

RC4/ARC4 encryption/decryption library for PHP.

0.1.0 2024-03-21 12:43 UTC

This package is auto-updated.

Last update: 2024-10-21 14:05:33 UTC


README

Tests Formats Version Total Downloads License

Installation

Requires PHP 8.3+

You can install the package via composer:

composer require felixdorn/php-rc4

Usage

$encrypted = \Felix\RC4\RC4::rc4('key', 'data')
$decrypted = \Felix\RC4\RC4::rc4('key', $encrypted);

In tests

\Felix\RC4\RC4::fake(function ($key, $data) {
    // Fake it if you need to for some reason.
});

Helpers

rc4('key', 'data'); // calls RC4::rc4

// Or, to be semantic:
$encrypted = rc4_encrypt('key', 'data');
$decrypted = rc4_decrypt('key', 'data');
// But both call rc4() under the hood

Testing

composer test

php-rc4 was created by Félix Dorn under the MIT license.