PHP.nl

openssl_private_encrypt

openssl_private_encrypt

Encrypts data with private key

bool **openssl_private_encrypt** string $data string $encrypted_data  $private_key int $padding
encrypts 

with private and stores the result into . Encrypted data can be decrypted via . openssl_private_encrypt``data``private_key``encrypted_data``openssl_public_decrypt

This function can be used e.g. to sign data (or its hash) to prove that it is not written by someone else.

data

encrypted_data

private_key must be the private key that corresponds to the public key that will be used to decrypt the data. private_key

padding can be one of , . padding``OPENSSL_PKCS1_PADDING``OPENSSL_NO_PADDING

return.success

openssl_public_encrypt``openssl_public_decrypt