0

When I run this:

<?php
openssl_decrypt('<string>', 'mcrypt_rijndael_256', '<key>', 0, '');
?>

I get this error:

Warning: openssl_decrypt(): Unknown cipher algorithm

I'm not sure if my VM is configured correctly to handle "mcrypt_rijndael_256". My phpinfo shows in the mcrypt section:

mcrypt
mcrypt support  enabled
mcrypt_filter support   enabled
Version     2.5.8
Api No  20021217
Supported ciphers   cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes     cbc cfb ctr ecb ncfb nofb ofb stream 

I have PHP 7.2.7. Do I need to add it to PHP somehow?

raphael75
  • 2,982
  • 4
  • 29
  • 44

1 Answers1

2

You are trying to use mcrypt's algorithm name in openssl functions, which won't work, because mcrypt and openssl are different extensions. Also RIJNDAEL_256 does not have a direct counterpart in openssl. See another question for more details.

Jirka Hrazdil
  • 3,983
  • 1
  • 14
  • 17