katoni/php-ffx

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

Maintainers

Package info

github.com/katoni/php-ffx

pkg:composer/katoni/php-ffx

Statistics

Installs: 32 518

Dependents: 1

Suggesters: 0

Stars: 6

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-02-27 14:18:27 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