micseres / micro-service-dh
Micro Service Diffie Hellman
Installs: 12 226
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.2
- ext-json: *
- ext-mcrypt: *
- ext-openssl: *
- ext-sockets: *
Requires (Dev)
- phpunit/phpunit: >=7.2
This package is auto-updated.
Last update: 2025-01-20 15:50:05 UTC
README
Usage
Alice
$this->dh = new DiffieHellman(true); $requestToBob = [ 'p' => $this->dh->getPrime(), 'g', $this->dh->getGenerator(), 'public_key', $this->dh->getPublicKey() ]; //... $pass = $this->dh->getSharedKey($responseFromBob->public_key)
Bob
$this->dh = new DiffieHellman(false); $this->dh->generatePrimaryAsSlave($requestFromBob['p'], $requestFromBob['g']); $pass = $this->dh->getSharedKey($requestFromBob->public_key)
License
The Soft Deletable Bundle is open-sourced software licensed under the MIT license.