[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/ -> PrivateKey.php (summary)

RSA Private Key

Author: Jim Wigginton
Copyright: 2015 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://phpseclib.sourceforge.net
File Size: 530 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 14 functions

  rsadp()
  rsasp1()
  exponentiate()
  blind()
  emsa_pss_encode()
  rsassa_pss_sign()
  rsassa_pkcs1_v1_5_sign()
  sign()
  rsaes_pkcs1_v1_5_decrypt()
  rsaes_oaep_decrypt()
  raw_encrypt()
  decrypt()
  getPublicKey()
  toString()

Functions
Functions that are not part of a class:

rsadp(BigInteger $c)   X-Ref
RSADP

See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}.

return: bool|\phpseclib3\Math\BigInteger

rsasp1(BigInteger $m)   X-Ref
RSASP1

See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}.

return: bool|\phpseclib3\Math\BigInteger

exponentiate(BigInteger $x)   X-Ref
Exponentiate

return: \phpseclib3\Math\BigInteger
param: \phpseclib3\Math\BigInteger $x

blind(BigInteger $x, BigInteger $r, $i)   X-Ref
Performs RSA Blinding

Protects against timing attacks by employing RSA Blinding.
Returns $x->modPow($this->exponents[$i], $this->primes[$i])

return: \phpseclib3\Math\BigInteger
param: \phpseclib3\Math\BigInteger $x
param: \phpseclib3\Math\BigInteger $r
param: int $i

emsa_pss_encode($m, $emBits)   X-Ref
EMSA-PSS-ENCODE

See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}.

return: string
param: string $m
param: int $emBits

rsassa_pss_sign($m)   X-Ref
RSASSA-PSS-SIGN

See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}.

return: bool|string
param: string $m

rsassa_pkcs1_v1_5_sign($m)   X-Ref
RSASSA-PKCS1-V1_5-SIGN

See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}.

return: bool|string
param: string $m

sign($message)   X-Ref
Create a signature

return: string
param: string $message
see: self::verify()

rsaes_pkcs1_v1_5_decrypt($c)   X-Ref
RSAES-PKCS1-V1_5-DECRYPT

See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}.

return: bool|string
param: string $c

rsaes_oaep_decrypt($c)   X-Ref
RSAES-OAEP-DECRYPT

See {@link http://tools.ietf.org/html/rfc3447#section-7.1.2 RFC3447#section-7.1.2}.  The fact that the error
messages aren't distinguishable from one another hinders debugging, but, to quote from RFC3447#section-7.1.2:

Note.  Care must be taken to ensure that an opponent cannot
distinguish the different error conditions in Step 3.g, whether by
error message or timing, or, more generally, learn partial
information about the encoded message EM.  Otherwise an opponent may
be able to obtain useful information about the decryption of the
ciphertext C, leading to a chosen-ciphertext attack such as the one
observed by Manger [36].

return: bool|string
param: string $c

raw_encrypt($m)   X-Ref
Raw Encryption / Decryption

Doesn't use padding and is not recommended.

return: bool|string
param: string $m

decrypt($ciphertext)   X-Ref
Decryption

return: bool|string
param: string $ciphertext
see: self::encrypt()

getPublicKey()   X-Ref
Returns the public key

return: mixed

toString($type, array $options = [])   X-Ref
Returns the private key

return: string
param: string $type
param: array $options optional