PHPackages                             paradisesecurity/secrets-manager - 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. paradisesecurity/secrets-manager

ActiveLibrary[Security](/categories/security)

paradisesecurity/secrets-manager
================================

Secrets management in PHP applications.

v0.1.0.x-dev(2y ago)00MITPHPPHP ^8.0

Since Feb 1Pushed 5mo agoCompare

[ Source](https://github.com/paradisesecurity/secrets-manager)[ Packagist](https://packagist.org/packages/paradisesecurity/secrets-manager)[ Docs](https://paradisesecurity.work)[ RSS](/packages/paradisesecurity-secrets-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (11)Versions (2)Used By (0)

Paradise Security Secrets Manager
=================================

[](#paradise-security-secrets-manager)

A modern, flexible secrets management library for PHP applications with a fluent builder API and multiple storage backends.

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)

Features
--------

[](#features)

- **Fluent Builder API** - Intuitive, chainable methods for configuration
- **Multiple Storage Backends** - File-based and environment-based key storage
- **Secure Encryption** - Built on Halite/libsodium for authenticated encryption
- **Vault Management** - Organize secrets into isolated vaults
- **Key Rotation** - Generate and manage cryptographic keys with ease
- **File &amp; Message Encryption** - Encrypt data of any size
- **Zero Configuration** - Sensible defaults with full customization

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

[](#installation)

```
composer require paradisesecurity/secrets-manager
```

Quick Start
-----------

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
use ParadiseSecurity\Component\SecretsManager\Builder\SecretsManagerBuilder;
use ParadiseSecurity\Component\SecretsManager\Key\Key;
use ParagonIE\HiddenString\HiddenString;

// Create authentication key
$authKey = new Key(
    new HiddenString('your-secure-auth-key'),
    'symmetric_authentication_key',
    'halite',
    '5.0.0'
);

// Build the secrets manager
$secretsManager = SecretsManagerBuilder::create()
    ->withAuthKey($authKey)
    ->withPaths('/path/to/project')
    ->withDefaultVault('production')
    ->configureStorage(fn($builder) =>
        $builder
            ->useMasterKeyStorage('env')
            ->withEnvFile('.env')
    )
    ->build();

// Create a vault
$secretsManager->newVault('production');

// Store secrets
$secretsManager->set('database_password', 'super_secret_password');
$secretsManager->set('api_key', 'sk-1234567890abcdef');

// Retrieve secrets
$dbPassword = $secretsManager->get('database_password');
$apiKey = $secretsManager->get('api_key');
```

### Advanced Configuration

[](#advanced-configuration)

```
$secretsManager = SecretsManagerBuilder::create()
    ->withAuthKey($authKey)
    ->withKeyringName('production-keyring')
    ->withDefaultVault('app-secrets')
    ->withPaths('/var/www/project', '/var/www/project/config/secrets')
    ->configureEncryption(fn($builder) =>
        $builder->useAdapter('halite')
    )
    ->configureStorage(fn($builder) =>
        $builder
            ->useMasterKeyStorage('env')
            ->withEnvFile('.env.production')
    )
    ->configureVault(fn($builder) =>
        $builder->withCache(true, 'secrets-cache')
    )
    ->build();
```

Architecture
------------

[](#architecture)

The Secrets Manager is built around a modular architecture with independent builders:

- **EncryptionBuilder** - Configure encryption adapters and key generation
- **StorageBuilder** - Manage filesystem paths and key storage mechanisms
- **VaultBuilder** - Configure vault adapters with optional caching
- **KeyManagerBuilder** - Coordinate key generation and management
- **SecretsManagerBuilder** - Orchestrate all components into a unified API

Each builder can be used independently or composed together for full functionality.

Storage Options
---------------

[](#storage-options)

### File-Based Storage

[](#file-based-storage)

Keys are stored as encrypted files in the filesystem:

```
$builder->configureStorage(fn($b) =>
    $b->useMasterKeyStorage('file')
);
```

### Environment-Based Storage

[](#environment-based-storage)

Keys are stored in `.env` files for easy deployment:

```
$builder->configureStorage(fn($b) =>
    $b->useMasterKeyStorage('env')
      ->withEnvFile('.env.secrets')
);
```

Documentation
-------------

[](#documentation)

Comprehensive documentation is available in the [docs](docs/index.md) folder:

- [Installation Guide](docs/installation.md)
- [Architecture Overview](docs/architecture.md)
- [Builder Pattern Guide](docs/builders.md)
- [Storage Systems](docs/storage.md)
- [Encryption Guide](docs/encryption.md)
- [Key Management](docs/keys.md)
- [Vault Management](docs/vaults.md)
- [Examples &amp; Recipes](docs/examples.md)

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

[](#requirements)

- PHP 8.1 or higher
- [paragonie/halite](https://github.com/paragonie/halite) ^5.0
- [paragonie/hidden-string](https://github.com/paragonie/hidden-string) ^2.0
- [symfony/options-resolver](https://github.com/symfony/options-resolver) ^6.0|^7.0
- [league/flysystem](https://github.com/thephpleague/flysystem) ^3.0

Development Status
------------------

[](#development-status)

⚠️ **This library is currently in active development.** APIs may change before the first stable release. Not recommended for production use yet.

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

Security
--------

[](#security)

If you discover any security vulnerabilities, please email  instead of using the issue tracker.

License
-------

[](#license)

This component is open-sourced software licensed under the [MIT license](LICENSE).

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Credits
-------

[](#credits)

- Created by [Paradise Security](https://github.com/paradisesecurity)
- Inspired by [Secretary for PHP](https://github.com/secretary/php)
- Built with [Halite](https://github.com/paragonie/halite) cryptography library

---

**Paradise Security** - Building secure, decoupled PHP components with the highest quality code.

[![Paradise Security](https://camo.githubusercontent.com/21014a4713cb0d4947c243af64c6f537d2efac76edf621178b2d0c609a160a74/68747470733a2f2f706172616469736573656375726974792e776f726b2f7372632f696d616765732f6c6f676f2d73706c6173682d62616e6e65722e706e67)](https://camo.githubusercontent.com/21014a4713cb0d4947c243af64c6f537d2efac76edf621178b2d0c609a160a74/68747470733a2f2f706172616469736573656375726974792e776f726b2f7372632f696d616765732f6c6f676f2d73706c6173682d62616e6e65722e706e67)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance50

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

828d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/474579d1e8eb1e54e3f5f4c2499bcc1a5b60de351e6eab3a4f43ca471a554c7d?d=identicon)[ParadiseStudios](/maintainers/ParadiseStudios)

---

Top Contributors

[![ParadiseStudios](https://avatars.githubusercontent.com/u/5958992?v=4)](https://github.com/ParadiseStudios "ParadiseStudios (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paradisesecurity-secrets-manager/health.svg)

```
[![Health](https://phpackages.com/badges/paradisesecurity-secrets-manager/health.svg)](https://phpackages.com/packages/paradisesecurity-secrets-manager)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M648](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[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)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[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)
