[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/phpseclib/phpseclib/phpseclib/Crypt/ -> DH.php (summary)

Pure-PHP (EC)DH implementation PHP version 5

Author: Jim Wigginton <[email protected]>
Copyright: 2016 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
File Size: 403 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  createParameters()
  createKey()
  computeSecret()
  load()
  onLoad()
  withHash()
  getHash()
  getParameters()

Functions
Functions that are not part of a class:

createParameters(...$args)   X-Ref
Create DH parameters

This method is a bit polymorphic. It can take any of the following:
- two BigInteger's (prime and base)
- an integer representing the size of the prime in bits (the base is assumed to be 2)
- a string (eg. diffie-hellman-group14-sha1)

return: Parameters

createKey(Parameters $params, $length = 0)   X-Ref
Create public / private key pair.

The rationale for the second parameter is described in http://tools.ietf.org/html/rfc4419#section-6.2 :

"To increase the speed of the key exchange, both client and server may
reduce the size of their private exponents.  It should be at least
twice as long as the key material that is generated from the shared
secret.  For more details, see the paper by van Oorschot and Wiener
[VAN-OORSCHOT]."

$length is in bits

param: Parameters $params
param: int $length optional
return: DH\PrivateKey

computeSecret($private, $public)   X-Ref
Compute Shared Secret

param: PrivateKey|EC $private
param: PublicKey|BigInteger|string $public
return: mixed

load($key, $password = false)   X-Ref
Load the key

param: string $key
param: string $password optional
return: AsymmetricKey

onLoad($components)   X-Ref
OnLoad Handler

param: array $components
return: bool

withHash($hash)   X-Ref
Determines which hashing function should be used

param: string $hash

getHash()   X-Ref
Returns the hash algorithm currently being used


getParameters()   X-Ref
Returns the parameters

A public / private key is only returned if the currently loaded "key" contains an x or y
value.

return: mixed



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer