323. Class

323.1. Zend\Crypt\Utils

Tools for cryptography

323.1.1. Methods

323.1.1.1. compareStrings

compareStrings()

Compare two strings to avoid timing attacks

C function memcmp() internally used by PHP, exits as soon as a difference is found in the two buffers. That makes possible of leaking timing information useful to an attacker attempting to iteratively guess the unknown string (e.g. password).

Parameters:
  • string
  • string
Return type:

bool

Project Versions

Table Of Contents

Previous topic

322. Class

Next topic

324. Class

This Page