PHPackages                             exonet/securemessage - 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. exonet/securemessage

ActiveLibrary[Security](/categories/security)

exonet/securemessage
====================

Encrypt and decrypt messages in a secure way.

v1.0.2(4y ago)1729.7k↑146.2%[1 PRs](https://github.com/exonet/securemessage/pulls)MITPHPPHP ^7.3|^8.0CI passing

Since Jul 6Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/exonet/securemessage)[ Packagist](https://packagist.org/packages/exonet/securemessage)[ RSS](/packages/exonet-securemessage/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (6)Dependencies (2)Versions (10)Used By (0)

SecureMessage
=============

[](#securemessage)

[![Latest Version on Packagist](https://camo.githubusercontent.com/24024d403184b1f9bdbd0e01889faac87934aacdd6dca413c67eba90d275c2ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65786f6e65742f7365637572656d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/exonet/securemessage)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/7ab8ac62dd0b405847bdbbbd74f603f838db3132c0adef217b5fe903cab5d629/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65786f6e65742f7365637572656d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/exonet/securemessage)

This package makes it possible to create (very) secure messages and store them in, for example, your database. A secure message is encrypted with a combination of three key 'parts':

- A "database key" - to be saved in a database.
- A "storage key" - to be stored on a disk/filesystem.
- A "verification code" - this code should *not* be stored anywhere.

This way, if an attacker has access to the database, it still has only access to a small part of the complete key. The same goes if an attacker has access to the file storage. Even if an attacker has access to the database *and* the file storage, a part of the complete key is still missing.

The verification code can be sent (securely) to the receiver of the secure message and with this code, it can decrypt the message and read it.

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

[](#requirements)

This package requires at least PHP 7.3 with the [sodium](https://www.php.net/manual/en/sodium.installation.php) extension enabled.

Install
-------

[](#install)

Via Composer

```
$ composer require exonet/securemessage
```

Usage
-----

[](#usage)

```
// Create the factory.
$secureMessageFactory = new Exonet\SecureMessage\Factory();
// Set the (application wide) meta key.
$secureMessageFactory->setMetaKey('A_10_random_characters_long_key.');

// Create a new SecureMessage. Note: it is not encrypted yet!
$secureMessage = $secureMessageFactory->make('Hello, world!');
// Encrypt the Secure Message.
$encryptedMessage = $secureMessage->encrypt();
```

Please see the `/docs` folder for complete documentation and additional examples.

Change log
----------

[](#change-log)

Please see [releases](https://github.com/exonet/securemessage/releases) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](.github/CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Exonet](https://github.com/exonet)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance58

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~261 days

Recently: every ~322 days

Total

6

Last Release

1657d ago

Major Versions

v0.1.2 → v1.0.02021-11-04

PHP version history (2 changes)v0.1.0PHP ~7.1

v1.0.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c233226e0fbf5dd5e3f42f3e1b832a51a825d08ca0d9e58abaf10c29740a9ba?d=identicon)[exonet](/maintainers/exonet)

---

Top Contributors

[![robbinjanssen](https://avatars.githubusercontent.com/u/120077?v=4)](https://github.com/robbinjanssen "robbinjanssen (31 commits)")[![trizz](https://avatars.githubusercontent.com/u/832056?v=4)](https://github.com/trizz "trizz (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![styxit](https://avatars.githubusercontent.com/u/1370548?v=4)](https://github.com/styxit "styxit (5 commits)")[![robinmulder](https://avatars.githubusercontent.com/u/120075?v=4)](https://github.com/robinmulder "robinmulder (3 commits)")[![petervmeijgaard](https://avatars.githubusercontent.com/u/5537701?v=4)](https://github.com/petervmeijgaard "petervmeijgaard (1 commits)")[![rsplithof](https://avatars.githubusercontent.com/u/805008?v=4)](https://github.com/rsplithof "rsplithof (1 commits)")[![jesperweiland](https://avatars.githubusercontent.com/u/372359?v=4)](https://github.com/jesperweiland "jesperweiland (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/exonet-securemessage/health.svg)

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

###  Alternatives

[phpids/phpids

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application

791150.0k2](/packages/phpids-phpids)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25866.3k44](/packages/paragonie-ecc)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

4912.6k](/packages/nicobleiler-php-passphrase)[dwgebler/encryption

Encryption wrapper for PHP using libsodium — simple API for symmetric and asymmetric encryption, password hashing, digital signing, and message authentication.

317.5k](/packages/dwgebler-encryption)

PHPackages © 2026

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