Overview
OCX uses SHA-256 cryptographic hashes to ensure installed components have not been tampered with. This protection happens automatically at install time and during updates.How It Works
- Receipt: When a component is first installed, its content is hashed and stored in
.ocx/receipt.jsonc. - Verification: On subsequent installs or updates, OCX re-hashes the incoming content.
- Protection: If the new hash does not match the one in
.ocx/receipt.jsonc, the installation is aborted with anINTEGRITY_ERROR.
Install-Time Verification
When you runocx add, OCX:
- Downloads the component content from the registry.
- If the component already exists in the receipt file, computes the SHA-256 hash of the incoming content.
- Compares against the recorded hash.
- If mismatch: Fails immediately with
INTEGRITY_ERROR. - If match or new: Writes files and records the hash.
Updating Components
TheINTEGRITY_ERROR is a security feature, not a bug. When you need to update a component whose source has changed, use ocx update:
CLI Binary Verification
When runningocx self update, OCX verifies the downloaded binary against the published SHA256SUMS.txt file in GitHub Releases. This protects against compromised mirrors, man-in-the-middle attacks, and tampered releases.
See Also
- Security Policy — Vulnerability disclosure and scope.
- Enterprise Overview — Registry locking, audit trail, and air-gapped deployment.
- ocx add — Component installation with integrity verification.