katoni/php-ffx

A pure PHP implementation of Format-preserving, Feistel-based encryption (FFX).

Installs: 28 060

Dependents: 1

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 3

Open Issues: 0

pkg:composer/katoni/php-ffx

v1.0 2023-03-27 07:45 UTC

This package is auto-updated.

Last update: 2025-09-27 13:34:41 UTC


README

A pure PHP implementation of Format-preserving, Feistel-based encryption (FFX).

Ported from emulbreh/pyffx.

Usage

$key = 'hello';
$alphabet = 'abcdefghijklmnopqrstuvwxyz';

$ffx = new \Katoni\FFX\Codecs\Text($key, $alphabet, 10);
$ffx->encrypt('encryption'); // string: jrsunxgmbq

$ffx = new \Katoni\FFX\Codecs\Integer($key, 4);
$ffx->encrypt('1234'); // int: 1867