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

Deprecated warnings on PHP 7.1 #55

Open
shadowhand opened this issue Oct 17, 2016 · 32 comments
Open

Deprecated warnings on PHP 7.1 #55

shadowhand opened this issue Oct 17, 2016 · 32 comments

Comments

@shadowhand
Copy link

When running RandomLib 1.2.0 under PHP 7.1, the following warning appears:

Function mcrypt_module_open() is deprecated

https://wiki.php.net/rfc/mcrypt-viking-funeral

@byrnedo
Copy link

byrnedo commented Nov 3, 2016

Hi, Any idea when this will be fixed?

@shadowhand
Copy link
Author

Sounds like never, since random_bytes effectively replaces it.

@byrnedo
Copy link

byrnedo commented Nov 3, 2016

Sorry, how do you mean?

Edit: Ah ok, you mean effectively replaces this lib in 7+?

@shadowhand
Copy link
Author

shadowhand commented Nov 3, 2016

It doesn't generate as much variation, but this works equally well:

$length = 32;
$random = substr(bin2hex(random_bytes($length)), 0, $length);

@it-can
Copy link

it-can commented Jan 8, 2017

Please fix this...

@abada
Copy link

abada commented Jan 11, 2017

Please fix it !

@romeritoCL
Copy link

+1

3 similar comments
@JanisGruzis
Copy link

+1

@codeator
Copy link

+1

@wernersbacher
Copy link

+1

@spidgorny
Copy link

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.

OpenSSLMixer.php

@mosiyash
Copy link

mosiyash commented Mar 9, 2017

+1

@Tjab
Copy link

Tjab commented Apr 5, 2017

Somehow, my error_reporting is set to -1, even though my php.ini shows E_ALL & ~E_DEPRECATED. Might be the issue for other people who can't continue with this...

@ramsey
Copy link
Collaborator

ramsey commented Apr 5, 2017

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.

@ramsey
Copy link
Collaborator

ramsey commented Apr 5, 2017

I'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

@vlyagusha
Copy link

Another one warning "Function mcrypt_enc_get_iv_size() is deprecated" in AbstractMcryptMixer.php at line 77

@techi602
Copy link

techi602 commented May 5, 2017

+1

@levelfivehub
Copy link

+1000000000

@techi602
Copy link

I had to abandon this library and use openssl_random_pseudo_bytes

@SamuelMoraesF
Copy link

+1

1 similar comment
@jazithedev
Copy link

+1

@paragonie-scott
Copy link

@techi602 Might not be a good idea. ramsey/uuid#80

See https://packagist.org/packages/paragonie/random_compat instead.

@pavarnos
Copy link

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?

@tarlepp
Copy link

tarlepp commented Sep 24, 2017

Any progress with this one ?

@the94air
Copy link

the94air commented Oct 5, 2017

A lot of people are using this package. It is so sad that it is not working any more.

@paragonie-scott
Copy link

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.

@the94air
Copy link

the94air commented Oct 5, 2017

I found an alternative here https://github.com/antonioribeiro/random. He is using random_bytes() and random_int()

@tarlepp
Copy link

tarlepp commented Oct 5, 2017

@ircmaxell any updates with this ?

@paragonie-scott
Copy link

In 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.

@ramsey
Copy link
Collaborator

ramsey commented Oct 5, 2017

I 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.

@paragonie-scott
Copy link

@ramsey I may, after I get my fork stable, send a PR from a branch that undoes the BC breaks to review.

@Lauriy
Copy link

Lauriy commented Dec 11, 2017

composer require paragonie/random-lib

"replace": { "ircmaxell/random-lib":"*" },

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