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

Function mcrypt_encrypt() is deprecated in PHP 7.1 #30

Closed
gtrias opened this issue Mar 9, 2017 · 3 comments
Closed

Function mcrypt_encrypt() is deprecated in PHP 7.1 #30

gtrias opened this issue Mar 9, 2017 · 3 comments

Comments

@gtrias
Copy link

gtrias commented Mar 9, 2017

The function mcrypt_encrypt is deprecated in PHP7.1.

It is used in Crevillo/Payum/Redsys/Api.php line 171. I'm not sure how it should be replaced.
I think it should be replaced by openssl_encrypt(). But I'm not sure if it will affect in the Bundle working in some way.

More info:

@crevillo
Copy link
Owner

crevillo commented Mar 9, 2017

good catch!. thanks a lot. i'll try to have a look to this during next weekend. prs are welcome btw! :)

@carmenates09
Copy link

carmenates09 commented Aug 4, 2017

This solution was by @dataclickes on eusonlito/redsys-TPV#14 meaby it help you to fix that.

function encrypt_3DES($message, $key) {

     $l = ceil(strlen($message) / 8) * 8;
    return substr(openssl_encrypt($message . str_repeat("\0", $l - strlen($message)), 'des-ede3-cbc', $key, OPENSSL_RAW_DATA, "\0\0\0\0\0\0\0\0"), 0, $l);
}

I tested on my integration with Redsys and work fine. jesusangel/wc-sermepa@9e0a013

Jose Carlos Ramos Carmenates.

@crevillo
Copy link
Owner

crevillo commented Aug 4, 2017

Thank you! Feel free to open a pr with this.

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

3 participants