katoni/php-ffx

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

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

This package is auto-updated.

Last update: 2024-12-27 11:42:26 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