Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CSPRNG, constant-time string compare #1

merged 2 commits into from May 3, 2015


Copy link

paragonie-scott commented May 3, 2015

New methods:

  • hashEquals() - constant-time string comparison
  • randomBytes() - pulls random bytes from whichever entropy source is available
  • safeStrlen() - mbstring.func_overload-safe strlen() (used by hashEquals())
New methods:

* `hashEquals()`
* `randomBytes()`
* `safeStrlen()`
Optimize `hashEquals()` by caching the result of `function_exists()`.

Also fixed a slight inconsistency with `phpversion()`.
Copy link

bitbeans commented May 3, 2015

Thank you scott!

bitbeans added a commit that referenced this pull request May 3, 2015
Expose CSPRNG, constant-time string compare
@bitbeans bitbeans merged commit a86c485 into bitbeans:master May 3, 2015
@paragonie-scott paragonie-scott deleted the paragonie-scott:patch-1 branch May 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.