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

RandomLib vs. random_compat #37

Open
adrienrn opened this issue Aug 16, 2015 · 6 comments
Open

RandomLib vs. random_compat #37

adrienrn opened this issue Aug 16, 2015 · 6 comments

Comments

@adrienrn
Copy link

Hi,

First, thanks for your work!

One thing that I don't understand is the difference between your two projects :

Which one should I use ?

RandomLib seems more maintained, object-oriented, depending on your SecurityLib and give more options like LowStrength / MediumStrengh (even if I kind of missed the difference between low and medium, but that must be a lack of knowledge regarding cryptography).

Thanks again,
Adrien.

@simensen
Copy link
Collaborator

@adrienrn The two projects are completely different and it depends on your use case. RandomLib is about generating random numbers and strings. password_compat is about providing compatibility with the password_* functions that ship with PHP 5.5 in the case that you need to work with earlier versions of PHP.

See:

In short, if you are dealing with creating and verifying password hashes, use password_compat. If you're using PHP 5.5+, you can just use these functions natively. If you need to generate random numbers or strings, use RandomLib.

If you can share more about what you are trying to do, I'm sure someone can provide more guidance. And if @ircmaxell disagrees what what I've written here (I'm only trying to help and get an answer to you quickly since I happen to be at my computer right now) he may have other things to say as to what the differences are but he'd probably still need to know more about what you're trying to do in order to better guide you. :)

@adrienrn
Copy link
Author

Arf, I made a mistake copy-and-pasting URL from the wrong tab, I was talking about random_compat :
https://github.com/ircmaxell/random_compat

Thanks for the quick reply !

@simensen
Copy link
Collaborator

@adrienrn OK! I think @ircmaxell will have to answer that question then. The nuances and subtle differences between those two packages I might not be able to help w/. :)

@ircmaxell
Copy link
Owner

I will be deprecating random_compat. Use either RandomLib or https://github.com/paragonie/random_compat (which is a php7 compatibility pack). Random_compat was more of an experiment.

@tom--
Copy link

tom-- commented Oct 13, 2015

Why not port random_bytes() to PHP 5? – php-internals list.

@lboynton
Copy link

lboynton commented Nov 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants