PHPackages                             sextanet/aduana - 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. sextanet/aduana

ActiveLibrary[Security](/categories/security)

sextanet/aduana
===============

Bidirectional channel to encrypt and decypt data

1.0.4(1y ago)020[1 PRs](https://github.com/sextanet/aduana/pulls)MITPHPPHP ^8.2CI passing

Since Dec 13Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/sextanet/aduana)[ Packagist](https://packagist.org/packages/sextanet/aduana)[ Docs](https://github.com/sextanet/aduana)[ GitHub Sponsors](https://github.com/sextanet)[ RSS](/packages/sextanet-aduana/feed)WikiDiscussions main Synced 1mo ago

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

Aduana
======

[](#aduana)

[![Latest Version on Packagist](https://camo.githubusercontent.com/92e24a69cf7d758984aca96f1cafaa08393e3be5526dd13fd8f3d1ba462e1808/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73657874616e65742f616475616e612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sextanet/aduana)[![Tests](https://camo.githubusercontent.com/ec29ab9671bd76f89521e580b0926c1694b4fda4097a25d9ed4d7860bedbd46e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73657874616e65742f616475616e612f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/sextanet/aduana/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/9407cbaab2652555bce19860a01325a3d922bc721aef4b8bc71b2d20644309ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73657874616e65742f616475616e612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sextanet/aduana)

A robust and easy-to-use package with bidirectional support to encrypt and decrypt data with AES-256-CBC.

> The original name Aduana is inspired by [@uppercod's aduana](https://packagist.org/packages/uppercod/aduana)

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

[](#installation)

You can install the package via composer:

```
composer require sextanet/aduana
```

Basic usage
-----------

[](#basic-usage)

Note

Since version 1.0.3, the password needs to be at least 10 characters

### Encrypt text

[](#encrypt-text)

```
// Step 1: set a password
\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

// Step 2: encrypt your data
return \SextaNet\Aduana\Aduana::encrypt('hello, from Aduana (:');
```

Returns encrypted text, like this: `dWSNOkN6mqxeCH0v3mzbWlJxRDJWTGE1WUxSQnN1eVNlbCtuNzdlOTFWSDUybFJIYVluNGNDMFZ4ajQ9`

### Decrypt text

[](#decrypt-text)

```
// Step 1: set a password
\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

// Step 2: decrypt your data
return \SextaNet\Aduana\Aduana::decrypt('dWSNOkN6mqxeCH0v3mzbWlJxRDJWTGE1WUxSQnN1eVNlbCtuNzdlOTFWSDUybFJIYVluNGNDMFZ4ajQ9');
```

Returns your original text: `hello, from Aduana (:`

Advanced usage
--------------

[](#advanced-usage)

You can also encrypt complex structures like arrays. With the same syntax to encrypt and decrypt 😎

### Encrypt an array

[](#encrypt-an-array)

```
\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

$array = [
    'your-complex-array' => [
        'another-level' => [
            'yes' => [
                'it works!' => [
                    'no problem!',
                ]
            ]
        ]
    ]
];

return \SextaNet\Aduana\Aduana::encrypt($array);
```

### Decrypt an array

[](#decrypt-an-array)

```
$decrypted_array = \SextaNet\Aduana\Aduana::decrypt('zwKOVw6zX2Jp8gNdQuE6TWRyNUR4MFFpN2lVaGIyeHZBMUljQXA1d2VuYjFZR3RKVkkzNC9HR25RampMUEQrSTdRbHVOT3VUU2hDL04rVXErSVNRL0FvTlAyMjRWa1pRVjdRS1RuSTFvRFBkRHVjMm9Pbm0ySnVnNnJVPQ==');

var_dump($decrypted_array);
```

Emojis (new)
------------

[](#emojis-new)

Aduana supports three emojis:

### Set password

[](#set-password)

```
Aduana::🔑('verySecretPassword');
```

### Encrypt

[](#encrypt)

```
Aduana::🔒('Hello, from Aduana!');
```

### Decrypt

[](#decrypt)

```
Aduana::🔓('Fvt2y2Q1Y26c1oh1Zr1YpXR2KzJKVlYyZzd5OUFpdEUyNi91MkR1UTMvMmtSbnVtWXhYVk5FU2Z2VWs9');
```

Functions
---------

[](#functions)

If you don't want to use PSR-4 and their imports, you can also use functions

### Set password

[](#set-password-1)

```
aduana_password('verySecretPassword');
```

### Encrypt

[](#encrypt-1)

```
aduana_encrypt('Hello, from Aduana!');
```

### Decrypt

[](#decrypt-1)

```
aduana_decrypt('Fvt2y2Q1Y26c1oh1Zr1YpXR2KzJKVlYyZzd5OUFpdEUyNi91MkR1UTMvMmtSbnVtWXhYVk5FU2Z2VWs9');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [SextaNet](https://github.com/sextanet)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% 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 ~5 days

Total

5

Last Release

501d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f00131e3e5dda3db4f1f0498fa677591bbd94d5c7087e24dcbd851cdecd9e84?d=identicon)[sextanet](/maintainers/sextanet)

---

Top Contributors

[![sebacarrasco93](https://avatars.githubusercontent.com/u/30738997?v=4)](https://github.com/sebacarrasco93 "sebacarrasco93 (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![sextanet-dev](https://avatars.githubusercontent.com/u/6735214?v=4)](https://github.com/sextanet-dev "sextanet-dev (4 commits)")

---

Tags

encryptdecrypteasySextaNetaduana

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sextanet-aduana/health.svg)

```
[![Health](https://phpackages.com/badges/sextanet-aduana/health.svg)](https://phpackages.com/packages/sextanet-aduana)
```

###  Alternatives

[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

961.0M2](/packages/nzo-url-encryptor-bundle)[xxtea/xxtea

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.

11341.7k](/packages/xxtea-xxtea)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)[hemiframe/php-aes

PHP class for encrypt and decrypt data with AES algorithm

1030.3k](/packages/hemiframe-php-aes)

PHPackages © 2026

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