PHPackages                             garyr/portunus - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. garyr/portunus

ActiveLibrary[File &amp; Storage](/categories/file-storage)

garyr/portunus
==============

A library for storing encrypted secrets

1.1.9(8y ago)55.4k1[1 PRs](https://github.com/garyr/portunus/pulls)MITPHPPHP &gt;=5.4.0

Since May 8Pushed 8y agoCompare

[ Source](https://github.com/garyr/portunus)[ Packagist](https://packagist.org/packages/garyr/portunus)[ RSS](/packages/garyr-portunus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (18)Used By (0)

[![Build Status](https://camo.githubusercontent.com/d5a58c1a835fa6928142c18f988ec88610373e56369bb5c6058b576983ebe6f1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f67617279722f706f7274756e75732e706e67)](http://travis-ci.org/garyr/portunus)

Portunus - The God of Keys
==========================

[](#portunus---the-god-of-keys)

A library for storing encrypted secrets

Install
-------

[](#install)

```
{
    "require": {
        "garyr/portunus": "1.0.*"
    },
    "scripts": {
        "post-update-cmd": [
            "Portunus\\Console\\Composer::postUpdate"
        ],
        "post-install-cmd": [
            "Portunus\\Console\\Composer::postInstall"
        ]
    }
}
```

Portunus Safe
-------------

[](#portunus-safe)

Portunus Safes can be synonymous with application environments (e.g. 'dev', 'test', 'prod', etc).

Safes and secrets are stored in an sqlite DB (defaults to `./data` dir in the parent dir of `vendor-dir` in your app). This path filename can be customized using composer "extra" values.

```
{
    "extra": {
       "portunus-data-dir": "data",
        "portunus-db-name": "portunus.sqlite"
    }
}

```

#### Creating a Safe

[](#creating-a-safe)

```
$ ./vendor/bin/portunus safe:create dev

Creating safe 'dev'... DONE

PLEASE STORE PRIVATE KEY (CANNOT BE RECOVERED)
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDNbnPVippiJucJ/Ikb0TpxhZXi58x99Mw/vAHhG5Og9HaLtdRp
...
-----END RSA PRIVATE KEY-----

```

**Important:** Please store the private key for later use. The private key will be required at run-time for decrypting of all secrets. Portunus does not provide a mechanism for storing or transferring private keys.

#### List Safes

[](#list-safes)

```
$ ./vendor/bin/portunus safe:list

+-----------+----------------------+-----------+---------------------+---------------------+
| Safe Name | Signature            | # Secrets | Created             | Updated             |
+-----------+----------------------+-----------+---------------------+---------------------+
| dev       | b7f67d9ea53c0d8c6... | 12        | 2015-05-07 16:30:46 | 2015-05-07 16:30:46 |
| test      | a55dbfe5222125270... | 12        | 2015-05-07 16:30:49 | 2015-05-07 16:30:49 |
| prod      | a87b4d977d7bcfe75... | 12        | 2015-05-07 16:30:52 | 2015-05-07 16:30:52 |
+-----------+----------------------+-----------+---------------------+---------------------+

```

Storing Secrets
---------------

[](#storing-secrets)

#### Store a secret Key:Value pair

[](#store-a-secret-keyvalue-pair)

```
$ ./vendor/bin/portunus secret:store dev foo bar

Using safe 'dev'...

Creating secret 'foo'... DONE

```

This command will encrypt the string 'bar' under the reference of 'foo' in the safe 'dev'

#### List stored secrets

[](#list-stored-secrets)

```
$ ./bin/portunus secret:list dev

+-----------+-------------------------+--------+---------------------+---------------------+
| Key Name  | Signature               | Length | Created             | Updated             |
+-----------+-------------------------+--------+---------------------+---------------------+
| foo       | fe1cbb60a0249ecbd3f2... | 128    | 2015-05-07 16:32:03 | 2015-05-07 16:32:03 |
| foo.foo   | 847b80314a68c84ab0c9... | 128    | 2015-05-07 16:33:21 | 2015-05-07 16:33:21 |
| foo3      | 0e0da8e1ef532f19120e... | 128    | 2015-05-07 16:33:41 | 2015-05-07 16:33:41 |
| foofoo    | 998d5692a9f162e07937... | 128    | 2015-05-07 16:33:18 | 2015-05-07 16:33:18 |
+-----------+-------------------------+--------+---------------------+---------------------+

```

#### Retrieving Secrets in your application

[](#retrieving-secrets-in-your-application)

```
// callback to deliver private key
$callback = function($safeName) {
    // this should return your private key
    return $myPrivateKeyBytes;
};

$Agent = new Portunus\Application\Agent();
$Agent->setSafe('dev');
$Agent->setPrivateKeyCallback($callback);

// retrieve decrypted value 'bar'
$value = $Agent->getKey('foo');
```

Testing
-------

[](#testing)

Basic PHPUnit Test Coverage

```
$ cd path/to/Portunus/
$ composer install
$ phpunit

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Recently: every ~234 days

Total

15

Last Release

3051d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.9

1.0.3PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bf345071f76d882894af6efe175ec8ddfafbae1521e50ea133135a8c5727ae1?d=identicon)[garyr](/maintainers/garyr)

---

Top Contributors

[![garyr](https://avatars.githubusercontent.com/u/449938?v=4)](https://github.com/garyr "garyr (35 commits)")

---

Tags

encryptionstoragesslkeycryptvaluesecrets

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/garyr-portunus/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[vich/uploader-bundle

Ease file uploads attached to entities

1.9k25.9M116](/packages/vich-uploader-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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