Password Generation Library

(I'm mostly creating this PR so Travis will run the tests. Cough.)

Features:
* Generate a random password
* Hash a password with PBKDF2
* Securely validate a PBKDF2 hash

Other changes made by this PR:
* Added test cases
* Added `CI_Security::compare()` to evaluate a string without leaking timing information
Math notation for ranges. Means up to but not including :)
On Aug 28, 2014 3:12 AM, "Andrey Andreev" <notifications@github.com> wrote:
>
> In system/libraries/Password_generator.php:
>
> > + }
> > + $rem = (PHP_INT_MAX - $range + 1) % $range;
> > + do {
> > + $val = $this->_random_positive_int();
> > + if ($val === false) {
> > + // RNG failure
> > + return false;
> > + }
> > + } while ($val < $rem);
> > + return $min + $val % $range;
> > + }
> > +
> > + //
--------------------------------------------------------------------
> > +
> > + /**
> > + * Return a random integer in the range [0, PHP_INT_MAX)
>
> Functionally irrelevant of course, but you're opening with a square
bracket and closing with parenthesis :D
>
> —
> Reply to this email directly or view it on GitHub.