Generated passwords aren't secure.rand is predictable, but you need a cryptographically secure pseudo random number generator (CSPRNG). As your project supports PHP 5.5, you will want to have a look at random_compat, that backports PHP 7's random_int and random_bytes to PHP 5.5+.
Generated passwords aren't secure.
rand
is predictable, but you need a cryptographically secure pseudo random number generator (CSPRNG). As your project supports PHP 5.5, you will want to have a look atrandom_compat
, that backports PHP 7'srandom_int
andrandom_bytes
to PHP 5.5+.