Re: Request for modificaton of OpenSSL_decrypt/encrypt documentation
[email protected] ("Christoph M. Becker") Mon, 9 Sep 2024 23:15:53 +0200
| Newsgroups | php.doc |
|---|---|
| Message-ID | <[email protected]> |
On 09.09.2024 at 22:42, [email protected] wrote: > Version: 8.2 > Both of the OpenSSL_decrypt/encrypt documentation use a "loose" > definition/explanation of a supposed private/public key used for > decryption/encryption. > > Example (public_decrypt): > > Parameters > "public_key must be the public key corresponding that was used to > encrypt the data." > > First of all, this is not the "best" English grammar. > Secondly, this does not explicitly clarify that the "corresponding key" > is supposed to be the previously used private key used to encrypt the data. > > Note: the initial statement after the function description implies the > "proper key" (but still not explicit) that was used to encrypt the data: > > "openssl_public_decrypt() decrypts data that was previous encrypted via > openssl_private_encrypt() and stores the result into decrypted_data." > > Proposed openssl_public_decrypt modification: > > public_key > "public_key must be the public key that corresponds to the private key > that was used to encrypt the data." > > Proposed openssl_private_decrypt modification: > private_key > > "private_key must be the private key that corresponds to the public key > that was used to encrypt the data." > > This clarifies the assymetric key-pair in both cases. Without this > clarification, there is an apparent discrepancy between the two > "descriptions of keys" used for the particular function. This should > also be applied "public_encrypt .." function. > > Similar modifications should also be applied to the "openssl_private..." > functions. > > Don't "assume" that things are (trivially) obvious. Of course, it's fine to write to this list, but it is better to file a ticket at <https://github.com/php/doc-en/issues>, and it's even better to submit a pull request at <https://github.com/php/doc-en/pulls>. :) Christoph