Download the PHP package mmeyer2k/secretbox without Composer
On this page you can find all versions of the php package mmeyer2k/secretbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package secretbox
secretbox
A minimalist libsodium secretbox implementation for PHP, supporting key rotation.
Features
- Encrypt and decrypt messages using libsodium's secretbox
- Support for key rotation (multiple keys for decryption)
- Simple API for secure key management
Installation
Install via Composer:
Requires PHP 8.2+ and the Sodium extension.
Usage
Basic encryption and decryption:
Key Management
Creating a Key
Generate a secure 32-byte key:
Storing a Key
Store keys in environment variables or configuration files as base64 strings. Decode before use:
Key Rotation
Support multiple keys for seamless rotation:
Decryption will succeed with any valid key in the array.
Error Handling
If decryption fails (e.g., no matching key), a \SodiumException is thrown:
License
MIT
All versions of secretbox with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
ext-sodium Version *
ext-sodium Version *
The package mmeyer2k/secretbox contains the following files
Loading the files please wait ...