micseres/micro-service-dh

Micro Service Diffie Hellman

Installs: 12 228

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/micseres/micro-service-dh

1.1.0 2021-04-20 07:46 UTC

This package is auto-updated.

Last update: 2025-09-20 17:09:38 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.