Repository navigation
Releases
Envelock 1.2.0
1.2.0 — 2026-11-30 (PHP 8.6, projects and keys in a store, faster protected files, internal audit)
Downloads
Envelock-1.2.0-complete.zip(320 MB): the source plus everything prebuilt — the 21 loaders, the Linux
and Windows assistants, a portable Python for Windows x64, Linux x86-64/ARM64 and macOS Apple silicon,
the offline wheels and the upstream sources; every file listed inprebuilt/SHA256SUMSor
third_party/SHA256SUMS.
SHA-2565b75a799081cb6148b54b32a1773dda7411edb97ae2bf4efe753d3673422bbb7Envelock-1.2.0-source.zip(2 MB): the source only.
SHA-256fabbfe4a2a7f91f1b731a2a53cb1472f8b92753a4bfb70c61b4b551723bf74eaphp_envelock-1.2.0*.zip: the 21 loaders as PIE assets — Linux x86-64 PHP 8.2–8.6 NTS and 8.4 ZTS,
Windows x64 PHP 8.2–8.6 NTS and TS, macOS on Apple silicon PHP 8.2–8.6 NTS — listed inSHA256SUMS.
Install withpie install miguelenred/envelock.envelock-assistant-1.2.0-macos-arm64.zip: the assistant as a macOS application (Apple silicon,
macOS 13+; not notarized: open it the first time with right-click → Open).
SHA-256445c9cc1e593c9ea267e0b81cbaf62faef1aa553413869e92e1a9d6c8b5f820cenvelock-assistant-1.2.0-windows-x64.exe: the assistant as one Windows x64 executable (no Python
needed), for package managers such as winget and Chocolatey. Not Authenticode-signed: SmartScreen may
ask the first time (More info → Run anyway). Built from the tag1.2.0(commit 3796216) and attested by
.github/workflows/assistant-windows.yml, a workflow added after this release and run from main, so
check it withgh attestation verify <file> --repo miguelenred/envelock --signer-workflow miguelenred/envelock/.github/workflows/assistant-windows.yml(without--source-ref). The copy
inside the complete ZIP was built on the maintainer's machine and is not attested.
SHA-25642e38fb97f7901779214424c49c14b94b81f8b8738600604fdfa20b64495dfaf
Every loader, PIE asset and the macOS application was built, tested and attested by
.github/workflows/release.yml from the tag 1.2.0:
gh attestation verify <file> --repo miguelenred/envelock. The macOS binaries have been tested by CI
only, not on a real Mac.
PHP 8.6. Supported, including bytecode mode: a new extension/opcache/php86 layer is php85's
hardened deserializer plus exactly what OPcache changed from 8.5 to 8.6 (a three-way merge of the
generated upstream code). PHP 8.6's partial function application adds three pointers to the callable
AST node (its file, name and argument list) and a new opcode; they are bounds-checked, claimed and
walked like the rest, and their "cacheable in shared memory" flag is cleared on every load, since an
image lives in request memory (scripts/check_bc_layers.py now requires it). Composer/PIE
(>=8.2.0 <8.7.0), the CI and release matrices, the PIE asset packaging (API 20261112; on Windows VS18, Visual Studio 2026, as the official PHP 8.6 builds) and the
container images include 8.6. NOTICE now records that the bytecode layers derive from PHP's OPcache
(PHP License 3.01 for 8.2–8.5, BSD-3-Clause for 8.6, as PHP relicensed it).
Prebuilt binaries: 21 loaders, now also for PHP 8.6 and macOS. .github/workflows/release.yml
builds, tests (tests/test_native.py against each loader, with a throwaway identity) and attests every
loader of the release; they are the PIE assets of the GitHub Release and the prebuilt/loader/ of the
complete distribution: Linux x86-64 PHP 8.2–8.6 NTS and 8.4 ZTS (6; portable builds on AlmaLinux 8.10
with OpenSSL 3.5.9 linked in), Windows x64 PHP 8.2–8.6 NTS and TS (10; 8.6 with VS18, Visual Studio
2026, and OpenSSL 4: it uses the official PHP 8.6's libcrypto-4-x64.dll) and, new, macOS on Apple silicon PHP 8.2–8.6 NTS (5; macOS 13+, OpenSSL 3.5.9 linked in, so Homebrew's
openssl@3 is not needed; PIE asset arm64-darwin-bsdlibc). Also new: the graphical assistant as a
macOS application, Envelock Assistant.app (Apple silicon, macOS 13+), built with PyInstaller from its
hash lock and started once with --selftest (Release asset envelock-assistant-1.2.0-macos-arm64.zip).
The macOS loaders and app are not notarized
(how to open them) and have been
built and tested by CI only, not on a real Mac. Still no prebuilt loader for Linux ARM64, musl/Alpine,
macOS on Intel or FreeBSD.
Docker with nothing to configure. Mount your identity file as /run/secrets/envelock-identity (a
Docker, Compose or Kubernetes secret, or a bind mount) and the image runs protected code: its entrypoint
copies the file where the loader accepts it (owned by the container's user, mode 0400, in memory) and
points PHP at it, so a host bind mount with another owner or a Kubernetes secret (a symbolic link) work
as they are. Without it, plain PHP runs as usual. New guide: docs/DOCKER.md, with how
to choose the PHP version (one tag per version).
Faster protected files, same protection. No format change: packages, identity files and licences
of 1.1.x work unchanged.
- The digest that keys the per-worker "already verified" cache, recomputed over every protected file
on every request and the largest per-request cost of a warm file, is now BLAKE2b on CPUs without SHA
instructions (about 1.8x faster in software) and stays SHA-256 where the CPU computes it in hardware
(envelock.cache_digest, defaultauto; phpinfo() shows which). Still a collision-resistant digest
of the WHOLE file, ciphertext included; signatures and manifest digests are unchanged. - Bytecode mode no longer wipes the request buffer's public ciphertext (a full pass over the image per
request, for bytes that were never secret: the plaintext lives only in its own buffer). - The runtime manifest check reuses one path buffer and seeds the fast-path digests once per worker
instead of on every request (they now live in their own table). - Measured on the published loaders (Linux, PHP 8.4.27, warm
php-cgirequests, 300 files of about
19 KB,pack's defaults, a Core i3-9100 without SHA instructions, best of 9 alternated rounds):
encrypted 329.4 → 282.7 µs/file (−14 %; what encryption adds to a file over plain PHP without
OPcache fell from 61 to 14 µs), bytecode mode 309.0 → 234.1 (−24 %, now 13 % faster than the same
code unencrypted without OPcache). In a real Laravel 13 application, encrypting its own code costs
2–4 % per page in both versions; the difference between the versions is within this machine's noise. - Known cost, CPUs without SHA instructions: in bytecode mode the first request each worker serves is
about 130 µs per file slower, because a file the worker has not seen yet is hashed twice there
(BLAKE2b for the cache, SHA-256 for the runtime manifest). The warm saving pays it back within a few
requests;envelock.cache_digest=sha256removes it at the cost of that saving
(docs/RENDIMIENTO.md). scripts/bench.pyalso measures warm requests (php-cgi -T), the runtime manifest and peak memory.- Outdated comments corrected: the test-only
envelock_bc_run()(the deserializer DOES validate
offsets; that entry stays test-only because it runs an image without the signature check), and the
leftovers of the dropped per-worker image cache (objective O9).
Projects and keys in a per-user store (SQLite), optional master password, backups.
store …andproject …commands, and two new tabs in the assistant (Projects, Store). A project
keeps its UUID, folders, signing and server keys, every pack option and its release history;
project packpacks exactly whatpackwith the same flags does.- Key files made before (owner, recipient,
.pub.json, developer descriptor; encrypted or not) import
into the store, and a package packed before becomes a project with its UUID and recorded options
(project import). Keys export back to the same JSON files, a private key always encrypted. - Nothing secret is kept in clear: without a master password each private key keeps its own
scrypt + AES-GCM envelope; with one, every row (names, options, keys) is sealed with AES-256-GCM under
a data key wrapped to the master password AND to a recovery code shown once (125 random bits). Lose
both and the store cannot be opened by anyone, which the user is told when turning it on. - With a master password an HMAC over the whole row set and the two slots' public keys catches a row
added, removed, moved or put back from an older copy; changing the password or the recovery code, or
recovering, replaces the data key and re-encrypts every row, so an older copy opened with an old
password reveals nothing written since. - Every change is one SQLite transaction: two windows or commands on one store take turns, and an
operation prepared outside one is refused when the store changed in between. The store's folder must
be the user's alone (it is checked, and created so), since SQLite's journal takes its permissions. store backup/store restore: the whole store, encrypted again under a backup password. A restore
checks the backup (integrity, nothing but the store's tables) and copies it INTO the store under
SQLite's own locking, keeping a copy of the replaced one as.before-restore-<date>-<random>.- Folders are stored as absolute paths;
project new --recommendkeeps recommend's file exclusions
and leaves--bytecodeoff (it needs a server-matching php, a loader with the emitter and a deploy
root; turned on without them,project packrefused the project), and so does the assistant;
project packprintspack's notes and warnings; only commands that add something create a store. - Developer side only: the loader never reads the store.
Container image. Built for PHP 8.2 to 8.6 (<version>-php8.x; <version> is the PHP 8.3 imag...
Envelock 1.1.2
1.1.2 — 2026-11-20 (end-to-end audit: deserializer hardening, attestations, continuous fuzzing)
No format change: 1.1.x packages, identity files and licences are unchanged and interoperate in both
directions, and nothing has to be repacked. A full end-to-end audit of the loader, the crypto core and
the encoder found no attacker-reachable defect (every finding sits behind the Ed25519 signature that is
verified before anything is decrypted or deserialized); this release closes the defense-in-depth gaps it
raised and adds supply-chain attestations and continuous fuzzing.
Loader — bytecode deserializer (defense-in-depth; it treats a signed image as hostile).
- Jump targets are validated (BC-16). Every branch —
JMP, the conditional jumps,CATCH,
FE_FETCH, theSWITCH/MATCHjump tables, and the 8.3+BIND_INIT_STATIC_OR_JMPand 8.4+
JMP_FRAMELESS— must land on an aligned opline of the same op_array. A relative jump offset (the
x86-64 default, never relocated at load) could otherwise point at bytes the VM reads as
opline->handlerand calls, hijacking control flow at execution time. The target is computed exactly
as the VM computes it (OP_JMP_ADDR/ZEND_OFFSET_TO_OPLINE) and checked after the opline walk. - Interface and trait names cannot be NULL (BC-17). An unlinked class resolves them at link time; a
NULL offset was a NULL dereference reachable outside the install guard with delayed binding. Refused
now, like class and function names. - PHP 8.5
IS_PTRis refused outside a genuine attributed-constant literal (BC-18). The loader
acceptedIS_PTRin every zval, leaving a raw image offset as a forged pointer in a property default,
class constant or nested array. Now only the attributed-constant attribute pointer — the one a
DECLARE_ATTRIBUTED_CONSTOP_DATAconsumes — is allowed, and everyIS_PTRliteral must be
relocated or it is refused. php82–84 already refusedIS_PTReverywhere; php85 now matches them. scripts/check_bc_layers.pypins all three layers.
Loader — sealed mode. A sealed package now refuses to run if Envelock's eval() gate (its
zend_compile_string hook) was replaced after MINIT; otherwise eval() could run unguarded under a
sealed package. Fail closed, and scoped to sealed packages only — non-sealed packages are unaffected.
Encoder. protect()'s default random file nonce clears the top bit, matching the counter pack_tree
passes, so a content-key nonce can never collide with the top-bit-set vault-wrap nonce even if a caller
lets protect() choose the nonce — the invariant now lives in the primitive, not only in the caller.
scripts/package-pie-assets.py reads both the text (<hash> name) and binary (<hash> *name)
sha256sum manifest forms, exactly like scripts/check_release.py.
Supply chain and CI.
- Every released loader and PIE asset is attested (GitHub artifact provenance,
actions/attest-build-provenance):
a signed record of the workflow, commit and run that produced each file. Verify any downloaded binary
withgh attestation verify <file> --repo miguelenred/envelock. The release workflow builds the Linux
loaders as portable glibc-2.28 binaries with OpenSSL 3 linked in, each download checked against its
published SHA-256. - The bytecode deserializer is fuzzed continuously in CI under AddressSanitizer + UndefinedBehaviorSanitizer
on every supported PHP (scripts/fuzz_bytecode.py): a mutated image must be rejected, never crash or
touch memory outside its buffer.
Encoder — analysis and obfuscation.
- The compatibility analysis is fully generic: no condition is tied to any named CMS or framework. The
six CMSs appear only in the documentation and in the tests that measure that Envelock protects them. - Control-flow flattening (
--obfuscate-flatten) randomises its state labels and is recommended by
default.
Compatibility measured on two more real applications, like the four CMSs; nothing in the loader or the
encoder changed for them. docs/DEPLOYING-APPS.md has the measurements and the recipes.
- CodeIgniter 4.7.6, its own code packed as bytecode, is identical to the cleartext application once
app/Config/Filters.phpstays cleartext. CodeIgniter's filter discovery reads that file and tokenizes it
to find its class (FileLocator::getClassname), so on an encrypted file it took the app's own config for
a module's and included it again: every request died withCannot redeclare class Config\Filters.
Migrations andspark routesuse the same reader. - Magento Open Source 2.4.8, its whole core packed (14,138 files), is identical on 15 probes (pages,
REST, GraphQL,bin/magento) as encryption only, as bytecode and with recommend's options.
Envelock 1.1.1
Envelock 1.1.1 makes the tools apply the memory guidance themselves: pack warns before Composer's vendor/ is shipped encrypted, and both pack and recommend estimate how much memory the encrypted code can cost.
No format change. Packages, identity files and licences are the same as in 1.1, so 1.1.0 and 1.1.1 packages and loaders work together in both directions. Nothing has to be repacked. The loader only changes the version it reports (php --ri envelock and phpinfo() say 1.1.1), so updating it is optional.
Memory
Protected files cannot be cached by OPcache. Each request compiles the ones it uses into its own memory, in every PHP worker. On a real Laravel 13.43 app under PHP-FPM with OPcache, a request took about 1 MB when only the app's own code was protected, the same as unprotected. It took 22 MB when vendor/ was protected too (measured).
packwarns whenvendor/goes into a package encrypted. This works on the command line and in the assistant. The warning gives the file count and size and the fix (--exclude 'vendor/*'). With--include-protection, which needsvendor/, it tells you to size the memory instead.packstates the memory ceiling of what it has just encrypted: roughly how much more memory a request that loaded all of it would need. The estimate is 3–9 times the source size, measured. When the ceiling passes PHP's defaultmemory_limit(128 MB),packsays so. It is a ceiling, not a forecast: a real request loads only the files it uses. The note is informational and is never written into the package.recommendgives the same estimate before packing, with how to measure the real figure.--jsonreturns it asmemory.- Sizing
memory_limitand PHP workers: docs/RENDIMIENTO.md.
Install the loader
-
PIE:
pie install envelock/loader. It picks the matching binary attached below:- Linux x86-64, glibc 2.28 or later: PHP 8.2–8.5 NTS and 8.4 ZTS. These have no system OpenSSL dependency.
- Windows x64: PHP 8.2–8.5, NTS and TS.
Anything else is built from source.
-
By hand: download the zip for your PHP from the assets and check it against
SHA256SUMS(sha256sum -c SHA256SUMS). -
docs/HOSTING.md lists what the loader needs from each operating system and hosting type.
scripts/envelock-preflight.phpis a pre-flight check for a target server.
Encode
Use python encoder/envelock.py (Python 3 with cryptography, hash-locked in requirements.lock) or the graphical assistant. Start with docs/MANUAL.md. envelock.py recommend --source <app> suggests the options for a given project, says why, and now estimates the memory.
Tested
Every job of the CI workflow passes on this tag:
- Linux x86-64 and ARM64;
- macOS 15;
- Windows NTS/TS for each supported PHP;
- PHP-FPM;
- real Laravel and Symfony apps with bytecode;
- static PHP, fuzzing and lint.
The binaries attached here are built from this source:
- Windows DLLs: built and tested by the repository's CI. Each passed with 966 passed, 0 failed, and each was then checked for its version, keys, paths and PE security flags.
- Linux loaders: built on AlmaLinux 8 (glibc 2.28). Each passes the native suite with 0 failed.
Details: TEST-STATUS.md.
Changes
CHANGELOG.md. Besides the memory notes above:
- The loader's version is now defined in one place. The module entry and the
phpinfo()row both use it. A source test and a native test pin it to the newest release. - The documentation (RENDIMIENTO, VERIFICACION, MANUAL, ASSISTANT) gives the Laravel memory figures. It also says that
recommendand the assistant already leavevendor/out, and suggest--strip-commentsonly when it is safe.
docs/SEGURIDAD.md states the limits:
- Envelock protects code at rest and in transit to the server.
- Anyone who can write to the deployed tree can replace files.
- Machine-bound licences are Linux-only.
Apache License 2.0.
Envelock 1.1.0
Envelock 1.1.0 closes the remaining findings of a consolidated second-pass audit (16 external reports → 36 findings) on top of 1.0.0, makes the loader faster, and makes the precompiled-bytecode images byte-for-byte reproducible.
This is a format bump. A 1.1 loader reads 1.0 packages and identity files unchanged, but a 1.0 loader does not read 1.1 ones. Roll out the loader first, then re-pack and re-export the identity with the 1.1 encoder.
Install the loader
-
PIE:
pie install envelock/loader. It picks the matching binary attached below:- Linux x86-64, glibc 2.28 or later: PHP 8.2–8.5 NTS and 8.4 ZTS. These have no system OpenSSL dependency.
- Windows x64: PHP 8.2–8.5, NTS and TS.
Anything else is built from source.
-
By hand: download the zip for your PHP from the assets and check it against
SHA256SUMS(sha256sum -c SHA256SUMS). -
What the loader needs from each operating system and hosting type is in docs/HOSTING.md. A pre-flight check for a target server is
scripts/envelock-preflight.php.
Encode
python encoder/envelock.py (Python 3 with cryptography, hash-locked in requirements.lock), or the graphical assistant. Start with docs/MANUAL.md; envelock.py recommend --source <app> suggests the options for a given project and says why.
Tested
Every job of the CI workflow passes on this tag:
- Linux x86-64 and ARM64;
- macOS 15;
- Windows NTS/TS for each supported PHP;
- PHP-FPM;
- real Laravel and Symfony apps with bytecode;
- static PHP, fuzzing and lint.
The Windows and Linux binaries attached here were also rebuilt from this source and tested natively before release (each Windows DLL: 964 passed, 0 failed; each Linux loader: 0 failed). Details: TEST-STATUS.md.
Changes
CHANGELOG.md. Highlights since 1.0.0:
- Bytecode no longer crashes on internal static methods (C-05) — fixed in both the emitter and the loader, so images packed by an older emitter run too.
- Release-mixing through a directory symlink is refused (C-11); the anti-rollback clock closes a read/advance race (C-10).
- Bytecode is off by default on multi-developer hosts (C-16); a loader-less server now fails closed with HTTP 500 (C-31); the identity file carries an integrity checksum (C-29).
- Reproducible bytecode images (H-09): the same source gives the same image across processes, including with a position-independent PHP.
- Encoder/assistant:
packwarns when--include-protectionis bypassable (C-30); the assistant gains Verify and Licence tabs.
This release includes the fixes from the consolidated audit and the code audits that followed (docs/AUDITORIA.md, through Pass 35).
Limits are stated in docs/SEGURIDAD.md:
- Envelock protects code at rest and in transit to the server.
- Anyone who can write to the deployed tree can replace files.
- Machine-bound licences are Linux-only.
Apache License 2.0.
Envelock 1.0.0
First release of Envelock: a PHP source encoder (Python) and a loader extension (C) for PHP 8.2–8.5. Packages are encrypted per file (AES-256-GCM) and signed (Ed25519); on top of that, opt-in layers ship precompiled bytecode instead of source, obfuscate, and seal the package tree.
Install the loader
-
PIE:
pie install envelock/loader. It picks the matching binary attached below:- Linux x86-64, glibc 2.28 or later: PHP 8.2–8.5 NTS and 8.4 ZTS. These have no system OpenSSL dependency.
- Windows x64: PHP 8.2–8.5, NTS and TS.
Anything else is built from source.
-
By hand: download the zip for your PHP from the assets and check it against
SHA256SUMS(sha256sum -c SHA256SUMS). -
What the loader needs from each operating system and hosting type is in docs/HOSTING.md. A pre-flight check for a target server is
scripts/envelock-preflight.php.
Encode
python encoder/envelock.py (Python 3 with cryptography, hash-locked in requirements.lock), or the graphical assistant. Start with docs/MANUAL.md; envelock.py recommend --source <app> suggests the options for a given project and says why.
Tested
Every job of the CI workflow passes on this tag:
- Linux x86-64 and ARM64;
- macOS 15;
- Windows NTS/TS for each supported PHP;
- PHP-FPM;
- real Laravel and Symfony apps with bytecode;
- static PHP, fuzzing and lint.
The Windows and Linux binaries attached here were also tested natively before release. Details: TEST-STATUS.md.
Changes
CHANGELOG.md. This release includes the fixes from the external audit of 2026-11-12 (docs/AUDITORIA.md, Pass 34).
Limits are stated in docs/SEGURIDAD.md:
- Envelock protects code at rest and in transit to the server.
- Anyone who can write to the deployed tree can replace files.
- Machine-bound licences are Linux-only.
Apache License 2.0.