Doc #76499 [Fbk->NoF]: openssl_decrypt The cipher method list lack

From: Date: Sun, 01 Jul 2018 04:22:24 +0000
Subject: Doc #76499 [Fbk->NoF]: openssl_decrypt The cipher method list lack
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15838@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76499&edit=1 ID: 76499 Updated by: php-bugs@lists.php.net Reported by: song_121292057 at 126 dot com Summary: openssl_decrypt The cipher method list lack -Status: Feedback +Status: No Feedback Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: 7.1.18 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2018-06-19 11:55:06] requinix@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2018-06-19 11:36:20] song_121292057 at 126 dot com Description: ------------ --- From manual page: http://www.php.net/function.openssl-decrypt --- null Test script: --------------- $str = 'AL1t8UIi4gt8eFZQu7R631eI40YK8CEgVHPWRekE4cG+rRbEAwbiFrZViHU9OMTJVcNO/dvMCwUbyOs6mQKQCw=='; $key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQChFetx5+VKDoEXzZ+5Wozt3MfWMM/TiKMlWmAKXBViv8/e6j6SU/lSlWkMajd59aiWczs+qf9dMuRpe/l9Qke9DnVMn24JNLXjWD+y+w3yKRwd3CTtF7gx8/ToZl5XqFIT5YB1QfQCdAf8Z18IdQrJIijs8ssczY/RfqKZLo+KLQIDAQAB'; $md5key = strtoupper(md5($key)); $key = hex2bin($md5key); $decrypted= mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($str), MCRYPT_MODE_ECB); $decrypted_error= openssl_decrypt(base64_decode($str),'AES-128-CBC',$key,OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING); $decrypted_success= openssl_decrypt(base64_decode($str),'AES-128-ECB',$key,OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING); print_r($decrypted); echo "<br/>"; print_r($decrypted_error); echo "<br/>"; print_r($decrypted_success); exit(); Expected result: ---------------- {"resCode":"99024","resMessage":"UNKNOW_SERVICE_EXCEPTION"} {"resCode":"99024�A�0G�F %1��X�uݭ D�v6��G����U�SR�Y�w�p8=�� {"resCode":"99024","resMessage":"UNKNOW_SERVICE_EXCEPTION"} ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76499&edit=1

« previous php.doc.bugs (#15838) next »