Repository navigation
Deprecated warnings on PHP 7.1 #55
Description
Activity
Hi, Any idea when this will be fixed?
Sounds like never, since
random_byteseffectively replaces it.Sorry, how do you mean?
Edit: Ah ok, you mean effectively replaces this lib in 7+?
It doesn't generate as much variation, but this works equally well:
$length = 32; $random = substr(bin2hex(random_bytes($length)), 0, $length);
Reacted by Jonny LauricianoPlease fix this...
Please fix it !
Reacted by Greg Bowler+1
+1
+1
+1
I was also stuck with this and had to make it working ASAP. I'm no-way a security specialist - I only have a vague idea of what I'm doing. Improvements are welcome.
+1
Somehow, my
error_reportingis set to-1, even though my php.ini showsE_ALL & ~E_DEPRECATED. Might be the issue for other people who can't continue with this...In PHP 7.2, the mcrypt library will be removed from core completely. There is a PECL extension for mcrypt, but you cannot install it on PHP 7.1, so you're left with a deprecation warning until 7.2.
We should update this lib to check for the extension and only provide mcrypt if the extension is present.
Reacted by iro88 and Arun UnnikrishnanI've just opened this request on bugs.php.net to ask that pecl/mcrypt be installable on PHP 7.1. https://bugs.php.net/bug.php?id=74375
2 remaining items
+1000000000
I had to abandon this library and use
openssl_random_pseudo_bytes+1
+1
@techi602 Might not be a good idea. ramsey/uuid#80
See https://packagist.org/packages/paragonie/random_compat instead.
If we change https://github.com/ircmaxell/RandomLib/blob/master/lib/RandomLib/AbstractMcryptMixer.php#L67 to
return version_compare(PHP_VERSION, '7.1') < 0 && extension_loaded('mcrypt');
would that fix it?
Any progress with this one ?
A lot of people are using this package. It is so sad that it is not working any more.
I'm debating forking it. It's been nigh impossible to get any feedback from Anthony for... going on a year now... from any venue or channel.
I found an alternative here https://github.com/antonioribeiro/random. He is using
random_bytes()andrandom_int()@ircmaxell any updates with this ?
Reacted by Greg Bowler, Rafael Tovar and Tiago GuimarãesIn the off-chance that it takes months or years before we hear back from @ircmaxell, I've gone ahead with a fork of this library.
https://github.com/paragonie/RandomLib
It solves this issue, by not loading mcrypt at all on PHP 7.1 and higher. Instead, the kernel's CSPRNG is preferred.
Reacted by Abdalla Arbab, elhardoum, abelwei, kabatak and milosb793Reacted by Abdalla ArbabI have commit/merge access on this library, and I’ll be happy to review and merge in any PR to address this that doesn’t break BC.
Reacted by Abdalla Arbab, Tarmo Leppänen and Dušan KlinecReacted by Abdalla Arbab@ramsey I may, after I get my fork stable, send a PR from a branch that undoes the BC breaks to review.
Reacted by Ben Ramsey, Andreas Möller, Ymox and Dušan Klineccomposer require paragonie/random-lib"replace": { "ircmaxell/random-lib":"*" },Reacted by Suraj Kumar Shrestha, Frank, Joey Gallegos and Wallef Antoine
When running RandomLib 1.2.0 under PHP 7.1, the following warning appears:
https://wiki.php.net/rfc/mcrypt-viking-funeral