Skip to content

Marqitos/php-dotenvx

Repository files navigation

PHP dotenvx

Plaintext .env files have been a major attack vector, but they've also been undeniably useful.

A secure dotenv (dotenvx.com)

"Dotenvx: Reducing Secrets Risk with Cryptographic Separation

Abstract. An ideal secrets solution would not only centralize secrets but also contain the fallout of a breach. While secrets managers offer centralized storage and distribution, their design creates a large blast radius, risking exposure of thousands or even millions of secrets. We propose a solution that reduces the blast radius by splitting secrets management into two distinct components: an encrypted secrets file and a separate decryption key.

..."

Read the whitepaper

Dotenvx decrypts your .env files. Using with cryptographic separation limiting their attack vector while retaining their benefits. Allowing use in small projects, on virtual servers, where it is not possible to run an external startup script for the application.

Important

But for this to be effective, the decryption keys (private key) and the application must be in separate environments, while maintaining security in each environment.

BSD 3-Clause License Latest Version Run unit tests (PHPUnit)

dotvenx

This library also provides an adapter to dump the .env values ​​into an array and a multi-level array.

How to use

See the documentation.


Under the hood, this is all implemented using the same public-key cryptography as Bitcoin.


📦 Available at Packagist: rodas/dotenvx

Ask DeepWiki

About

DotEnvX encryption for PHP

Resources

License

Stars

Watchers

Forks

Languages