smakecloud/laravel-sodium is a Laravel package for laravel libsodium.
It currently has 3 GitHub stars and 18 downloads on Packagist (latest version v0.0.2).
Install it with composer require smakecloud/laravel-sodium.
Discover more Laravel packages by smakecloud
or browse all Laravel packages to compare alternatives.
Last updated
Uses PHP's Sodium extension to encrypt, decrypt, sign and verify data.
Note Package name was chosen for discoverability. It is not affiliated with Laravel.
Supported encryption ciphers are:
Supported signing algorithms are:
Signing KeyPair is generated using app.key for seeding.
Warning This package overrides Laravel's Encrypter class!
You will lose support for the following ciphers:
You can install the package via composer:
composer require smakecloud/laravel-sodium
This package uses Laravel's auto-discovery feature. After you install it the package provider and facade are available immediately.
This package overrides Laravel's Encrypter class. You can use it as you would use the default Encrypter class.
You can change the default cipher in:
config/app.php
return [
//...
'cipher' => 'XCha-Cha20-Poly1305',
//...
]
$encrypted = encrypt('secret');
$decrypted = decrypt($encrypted); // 'secret'
$signed = sign('secret');
$verified = verify($signed); // 'secret'
$signature = sign_detached('secret');
$verified = verify_detached($signature, 'secret'); // true
composer test
composer test:coverage
composer phpstan
composer lint(:fix)
This package is not affiliated with Laravel in any way.
Read the documentation of PHPs sodium extension before using this package !
We don't take any responsibility for any damage caused by this package.
The MIT License (MIT). Please see License File for more information.