19.4. OpenSSL

The OpenSSL extension wraps a subset of the functions in the OpenSSL library, allowing you to perform public key cryptography. They allow you to make and verify signatures, and they allow you to encrypt and decrypt data.

Public key cryptography uses a pair of keys: One key encrypts data and the other decrypts it. Compare this to simple encryption schemes that use the same password to encrypt and decrypt. With two keys, the owner can keep one key private while making the other public. Anyone can use the public key to encrypt data for the holder of the private key. Without the private key, the data remains unreadable.

This extension allows you to refer to keys in several ways. One way is with a resource generated by one of the key-reading ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.