PHPackages                             smakecloud/laravel-sodium - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. smakecloud/laravel-sodium

ActiveLibrary[Security](/categories/security)

smakecloud/laravel-sodium
=========================

Laravel libsodium

v0.0.2(3y ago)3182MITPHPPHP ^8.1

Since Jun 21Pushed 3y ago4 watchersCompare

[ Source](https://github.com/smakecloud/laravel-sodium)[ Packagist](https://packagist.org/packages/smakecloud/laravel-sodium)[ Docs](https://github.com/smakecloud/laravel-sodium)[ RSS](/packages/smakecloud-laravel-sodium/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Laravel Sodium
==============

[](#laravel-sodium)

[![phpunit](https://github.com/smakecloud/laravel-sodium/actions/workflows/phpunit.yml/badge.svg)](https://github.com/smakecloud/laravel-sodium/actions/workflows/phpunit.yml)[![phpstan](https://github.com/smakecloud/laravel-sodium/actions/workflows/phpstan.yml/badge.svg)](https://github.com/smakecloud/laravel-sodium/actions/workflows/phpstan.yml)

Uses [PHP's Sodium](https://www.php.net/manual/en/book.sodium.php) 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:

- [XCha-Cha20-Poly1305](https://www.php.net/manual/en/function.sodium-crypto-aead-xchacha20poly1305-ietf-encrypt.php)
- [AES-256-GCM](https://www.php.net/manual/en/function.sodium-crypto-aead-aes256gcm-encrypt.php)

Supported signing algorithms are:

- [Ed25519](https://www.php.net/manual/en/function.sodium-crypto-sign.php)

*Signing KeyPair is generated using `app.key` for [seeding](https://www.php.net/manual/en/function.sodium-crypto-sign-seed-keypair.php).*

> **Warning**This package overrides Laravel's Encrypter class!

You will lose support for the following ciphers:

- AES-128-CBC
- AES-256-CBC
- AES-128-GCM

---

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Development](#development)
    - [Testing](#testing)
    - [Coverage](#coverage)
    - [Static analysis](#static-analysis)
    - [Code style](#code-style)
- [Disclaimer](#disclaimer)
- [License](#license)

Requirements
------------

[](#requirements)

- PHP 8.1+
- Sodium extension ( obviously )

Installation
------------

[](#installation)

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.

Usage
-----

[](#usage)

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
```

Development
-----------

[](#development)

### Testing

[](#testing)

```
composer test
```

### Coverage

[](#coverage)

```
composer test:coverage
```

### Static analysis

[](#static-analysis)

```
composer phpstan
```

### Code style

[](#code-style)

```
composer lint(:fix)
```

Disclaimer
----------

[](#disclaimer)

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.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1110d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73649478?v=4)[florianover](/maintainers/florianover)[@florianover](https://github.com/florianover)

---

Top Contributors

[![florianoversmake](https://avatars.githubusercontent.com/u/90754499?v=4)](https://github.com/florianoversmake "florianoversmake (9 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smakecloud-laravel-sodium/health.svg)

```
[![Health](https://phpackages.com/badges/smakecloud-laravel-sodium/health.svg)](https://phpackages.com/packages/smakecloud-laravel-sodium)
```

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
