php / doc-en

English PHP documentation
506 stars 738 forks source link

Description of OPENSSL_RAW_DATA is wrong #3826

Open tomty89 opened 1 month ago

tomty89 commented 1 month ago

From manual page: https://php.net/openssl.constants.other

If OPENSSL_RAW_DATA is set in the openssl_encrypt() or openssl_decrypt(), the returned data is returned as-is. When it is not specified, Base64 encoded data is returned to the caller.


For openssl_decrypt(), OPENSSL_RAW_DATA does NOT affect the representation of the returned data, but is used to indicate whether "data" (i.e., the ciphertext) is raw or base64-encoded. The function always returns the "plaintext" as-is.

cmb69 commented 1 month ago

That makes sense. Thank you!

I wonder if it's best to move the actual description to the functions, and to only document the constant to be used with openssl_encrypt() and openssl_decrpyt().