简体   繁体   English

PHP错误:警告:openssl_decrypt():未知密码算法

[英]PHP error: Warning: openssl_decrypt(): Unknown cipher algorithm

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". 我不确定我的VM是否已正确配置为处理“ mcrypt_rijndael_256”。 My phpinfo shows in the mcrypt section: 我的phpinfo在mcrypt部分显示:

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. 我有PHP 7.2.7。 Do I need to add it to PHP somehow? 是否需要以某种方式将其添加到PHP?

You are trying to use mcrypt's algorithm name in openssl functions, which won't work, because mcrypt and openssl are different extensions. 您正在尝试在openssl函数中使用mcrypt's算法名称,这将不起作用,因为mcryptopenssl是不同的扩展名。 Also RIJNDAEL_256 does not have a direct counterpart in openssl . 而且RIJNDAEL_256openssl中没有直接对应的对象。 See another question for more details. 有关更多详细信息,请参见另一个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM