spatie/crypto
Generate RSA key pairs and encrypt/decrypt (and sign/verify) data using private/public keys in PHP. Provides simple wrappers around OpenSSL for better DX, with support for loading keys from files and writing generated keys to disk.
Use this when:
openssl_* functions.Look elsewhere when:
For Executives: "This package lets us securely encrypt and sign data with minimal engineering overhead—critical for protecting customer data, complying with regulations, and securing internal communications. It’s like adding a ‘security layer’ to our stack without hiring cryptographers. For example, we could use it to encrypt sensitive user data before storing it, or to verify the integrity of API requests from our microservices. The risk of custom crypto is high; this gives us enterprise-grade security with zero reinvention."
For Engineering:
*"Spatie’s crypto package wraps OpenSSL’s RSA functions in a clean, Laravel-friendly API. It handles key generation, encryption/decryption, and signing—so we don’t have to debug OpenSSL quirks or manage raw PEM files. Perfect for:
How can I help you explore Laravel packages today?