katoni / php-ffx
A pure PHP implementation of Format-preserving, Feistel-based encryption (FFX).
Installs: 20 875
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- ext-gmp: *
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.1.5
- vimeo/psalm: ^3.11
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