1

I’m using

mcrypt_decrypt(MCRYPT_BLOWFISH...

I’ve upgraded to PHP 7.2 and mcrypt is now removed. Is there a drop in replacement?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Josh Petitt
  • 9,371
  • 12
  • 56
  • 104
  • 1
    https://stackoverflow.com/questions/41272257/php-7-mcrypt-deprecated-need-alternative – Dave Carruthers Dec 28 '17 at 19:26
  • 2
    I don’t think this is a duplicate since I was asking specifically about the MCRYPT_BLOWFISH algorithm. Note my answer has the details to replace this, not another algorithm. – Josh Petitt Dec 28 '17 at 20:16
  • @JoshPetitt True. I edited that one out and replaced them with two other ones. A Google search for "alternative to mcrypt_decrypt php 7" produced both of those. – Funk Forty Niner Dec 28 '17 at 20:20
  • 1
    @Sammitch Please read the question carefully before choosing a duplicate. I had to edit it. See my above to Josh. – Funk Forty Niner Dec 28 '17 at 20:21
  • I wasn't marking as a dupe, I posted the link as its relevant since the accepted answer mentions libsodium and Defuse Which I believe are the PHP 7+ alternatives to mcrypt. – Dave Carruthers Dec 28 '17 at 20:35
  • 1
    @DaveCarruthers We weren't questioning yours Dave, but the one that Sammitch chose as the duplicate originally used to hammer the question. Your link however was a good one though. – Funk Forty Niner Dec 28 '17 at 21:27

1 Answers1

1

This seems to work

openssl_decrypt($data, 'BF-ECB', $key, OPENSSL_RAW_DATA | OPENSSL_NO_PADDING)
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Josh Petitt
  • 9,371
  • 12
  • 56
  • 104