PHPackages                             scrothers/libsodium-laravel - 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. scrothers/libsodium-laravel

ActiveLibrary[Security](/categories/security)

scrothers/libsodium-laravel
===========================

Laravel bindings for libsodium in the encrypter and hasher

2355[1 issues](https://github.com/scrothers/libsodium-laravel/issues)PHP

Since Mar 4Pushed 10y ago4 watchersCompare

[ Source](https://github.com/scrothers/libsodium-laravel)[ Packagist](https://packagist.org/packages/scrothers/libsodium-laravel)[ RSS](/packages/scrothers-libsodium-laravel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Libsodium for Laravel
=====================

[](#libsodium-for-laravel)

This library is meant to be a fairly expansive encryption replacement to Laravel's built in methods. The goals is that by default it will replace the encryption and the hashing mechanisms of Laravel with compatible methods powered by libsodium.

How to Install
--------------

[](#how-to-install)

First thing you need to do is install the components you want to replace in Laravel in your `app.cfg` file from your config directory.

### Sodium Encrypter Install

[](#sodium-encrypter-install)

In `app.cfg` replace `Illuminate\Encryption\EncryptionServiceProvider::class` with `scrothers\laravelsodium\Providers\EncryptionProvider::class`.

### Sodium Hasher Install

[](#sodium-hasher-install)

In `app.cfg` replace `Illuminate\Hashing\HashServiceProvider::class` with `scrothers\laravelsodium\Providers\HashProvider::class`.

About Sodium
------------

[](#about-sodium)

The original Sodium project can be located [here](https://github.com/jedisct1/libsodium), the about Sodium is obtained from the readme in the source repository.

Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.

It is a portable, cross-compilable, installable, packageable fork of [NaCl](http://nacl.cr.yp.to/), with a compatible API, and an extended API to improve usability even further.

Its goal is to provide all of the core operations needed to build higher-level cryptographic tools.

Sodium supports a variety of compilers and operating systems, including Windows (with MingW or Visual Studio, x86 and x64), iOS and Android.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c7c149504d222079e5a5bfb86c347b796ce2d2d7357cdf4e255eea417c3b7d1?d=identicon)[scrothers](/maintainers/scrothers)

---

Top Contributors

[![scrothers](https://avatars.githubusercontent.com/u/111015?v=4)](https://github.com/scrothers "scrothers (20 commits)")[![bitbeans](https://avatars.githubusercontent.com/u/1482102?v=4)](https://github.com/bitbeans "bitbeans (4 commits)")

### Embed Badge

![Health badge](/badges/scrothers-libsodium-laravel/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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