Skip to content

katoni/php-ffx

Repository files navigation

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