[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/inc/3rdparty/2fa/ -> GoogleAuthenticator.php (summary)

(no description)

File Size: 252 lines (8 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PHPGangsta_GoogleAuthenticator:: (8 methods):
  createSecret()
  getCode()
  getQRCodeGoogleUrl()
  verifyCode()
  setCodeLength()
  _base32Decode()
  _getBase32LookupTable()
  timingSafeEquals()


Class: PHPGangsta_GoogleAuthenticator  - X-Ref

PHP Class for handling Google Authenticator 2-factor authentication.
createSecret($secretLength = 16)   X-Ref
Create new secret.
16 characters, randomly chosen from the allowed base32 characters.

return: string
param: int $secretLength

getCode($secret, $timeSlice = null)   X-Ref
Calculate the code, with given secret and point in time.
return: string
param: string   $secret
param: int|null $timeSlice

getQRCodeGoogleUrl($name, $secret, $title = null, $params = array()   X-Ref
Get QR-Code URL for image, from google charts.
return: string
param: string $name
param: string $secret
param: string $title
param: array  $params

verifyCode($secret, $code, $discrepancy = 1, $currentTimeSlice = null)   X-Ref
Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now.
return: bool
param: string   $secret
param: string   $code
param: int      $discrepancy      This is the allowed time drift in 30 second units (8 means 4 minutes before or after)
param: int|null $currentTimeSlice time slice if we want use other that time()

setCodeLength($length)   X-Ref
Set the code length, should be >=6.
return: PHPGangsta_GoogleAuthenticator
param: int $length

_base32Decode($secret)   X-Ref
Helper class to decode base32.
return: bool|string
param: $secret

_getBase32LookupTable()   X-Ref
Get array with all 32 characters for decoding from/encoding to base32.
return: array

timingSafeEquals($safeString, $userString)   X-Ref
A timing safe equals comparison
more info here: http://blog.ircmaxell.com/2014/11/its-all-about-time.html.

return: bool True if the two strings are identical
param: string $safeString The internal (safe) value to be checked
param: string $userString The user submitted (unsafe) value



2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref