PHPackages                             hernandev/laravel-aead - 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. hernandev/laravel-aead

ActiveLibrary[Security](/categories/security)

hernandev/laravel-aead
======================

Advanced Encryption with Associated Data (AEAD) for Laravel.

0.1.2(8y ago)5238[3 issues](https://github.com/hernandev/laravel-aead/issues)[1 PRs](https://github.com/hernandev/laravel-aead/pulls)MITPHPPHP &gt;=7.2.0

Since Apr 21Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (5)Used By (0)

LaravelAEAD.
============

[](#laravelaead)

**LaravelAEAD** is a library which provides *Advanced Encryption with Associated Data* (AEAD) for Laravel.

Abstract:
---------

[](#abstract)

This package replaces, when installed and enabled, the default encryption implementation of Laravel, which currently supports only two variants of the same block cipher, `AES-128-CBC` and `AES-256-CBC`.

The reason for only having two options is probably based on PHP history itself, like the (not so much) rececent depreciation of MCrypt.

As of PHP 7.2, we can now count on the exceptional `libsodium` extension, with supports the most secure AEAD construtions and it's variants.

AEAD stands for Advanced Encryption, with Associated Data, and they are algorithms which combine a **stream cipher** with a **message authentication** code (MAC).

The result of such combination is a encryption scheme with provides three aspects that are useful for modern applications:

- Confidentiality
- Integrity
- Authenticity

For more information on AEAD, I highly recommend [reading the libsodium documentation](https://download.libsodium.org/doc/secret-key_cryptography/aead.html), which states the main parts, but, reading the construction IETF RFC's is also something interesting if you care for security.

Available Constructions.
------------------------

[](#available-constructions)

Those are the libsodium AEAD constructors, and they respective key for usage with this package.

AEAD Cipher / ContructionKey SizeNonce SizeConfig Key (config/app.php)XChaCha20-Poly1305-IEFT256 bits192 bits'XCHACHA20-POLY1305-IEFT'ChaCha20-Poly1305-IEFT256 bits96 bits'CHACHA20-POLY1305-IEFT'ChaCha20-Poly1305256 bits64 bits'CHACHA20-POLY1305'AES-256-GCM256 bits96 bits'AES-256-GCM'Installing &amp; Configuring.
-----------------------------

[](#installing--configuring)

Installing the Library.

```
composer require hernandev/laravel-aead
```

Changing the authentication provider (on config/app.php):

```
    // YOU MUST COMMENT OUT THE DEFAULT ENCRYPTION CLASS>
    // Illuminate\Encryption\EncryptionServiceProvider::class,
    // THIS ONE SHOULD BE USED INSTEAD.
    LaravelAEAD\Providers\EncryptionServiceProvider::class,
```

Configuring the cipher (also on config/app.php):

```
    'cipher' => 'XCHACHA20-POLY1305-IETF',
```

Usage.
------

[](#usage)

After doing this install, all default Laravel encryption will be performed under the relative constructions / ciphers.

Meaning if you use `encrypt()` and `decrypt()`, they will use this package instead of the default encryption.

It also means that cookies &amp; session, that should be encrypted, will use it.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

3

Last Release

2940d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/799b2351104c65a512e9d428cce029e2e51cfa1ba10342ba50aba3bd5b71bf71?d=identicon)[hernandev](/maintainers/hernandev)

---

Tags

laravelcryptographyencryptionaeadChaCha20Xchacha20Poly1305aes-256-gcm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hernandev-laravel-aead/health.svg)

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

###  Alternatives

[paragonie/sodium_compat

Pure PHP implementation of libsodium; uses the PHP extension if it exists

934131.6M153](/packages/paragonie-sodium-compat)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)[poly-crypto/poly-crypto

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+

127.8k1](/packages/poly-crypto-poly-crypto)

PHPackages © 2026

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