Registry / crypto / defuse-php-encryption

defuse-php-encryption

JSON →
library2.4.0phppackagistunverified

Secure PHP Encryption Library.

composer require defuse/php-encryption
INSTALL
IMPORT
SIG · DEFUSE-PHP-ENCRYPT
D
defuse-php-encryption
cryptophpv2.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Crypto
use Defuse\Crypto\Crypto;

Encrypt and decrypt a string using a random key.

use Defuse\Crypto\Crypto; use Defuse\Crypto\Key; $key = Key::createNewRandomKey(); $ciphertext = Crypto::encrypt('Hello World', $key); $plaintext = Crypto::decrypt($ciphertext, $key);
Debug
Known issues
breakingThe library requires PHP 7.2 or higher and the sodium extension.
fix
Ensure PHP version >= 7.2 and install the sodium extension (usually built-in from PHP 7.2).
affects: >=2.0.0
Upgrade
Version history
2.4.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
Amazon
1
Resources
defuse-php-encryption — pip install defuse-php-encryption · libregistry