kduma / pkv
Partial Key Verification Library for PHP
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
pkg:composer/kduma/pkv
Requires
- php: ^8.4
- ext-dom: *
Requires (Dev)
- laravel/pint: ^1.0
- phpunit/phpunit: ^10.3.2
- dev-master
- v0.0.1
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-7
- dev-dependabot/composer/phpunit/phpunit-12.4.1
- dev-dependabot/composer/phpunit/phpunit-12.4.0
- dev-dependabot/composer/phpunit/phpunit-12.3.8
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-6
- dev-dependabot/github_actions/actions/checkout-5
This package is auto-updated.
Last update: 2025-10-13 02:40:34 UTC
README
This is a port of my other C# library Partial Key Verification Library for Compact Framework into a PHP package.
This library implements Partial Key Verification (PKV). PKV is a cryptographic technique that allows verification of a subset of a key without revealing the entire key, enhancing security and privacy in various applications.
Check full documentation here: opensource.duma.sh/libraries/php/partial-key-verification
Installation
You can install the package via composer:
composer require kduma/pkv
Usage
private static function validateKey(string $key): bool { $seed = \KDuma\PKV\PartialKeyValidator::getSerialNumberFromKey($key); $blacklist = [1518008798, 42]; if (in_array($seed, $blacklist, true)) return false; // Validation for key with index 1 if (!\KDuma\PKV\PartialKeyValidator::validateKey(new \KDuma\PKV\Checksum\Adler16(), new \KDuma\PKV\Hash\OneAtATime(), $key, 1, 766109221)) return false; // Validation for key with index 4 if (!\KDuma\PKV\PartialKeyValidator::validateKey(new \KDuma\PKV\Checksum\Adler16(), new \KDuma\PKV\Hash\Fnv1a(), $key, 4, 4072442218)) return false; return true; }
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
Packagist
View this package on Packagist.org: kduma/pkv