Download the PHP package ivansostarko/otto-crypt-php without Composer

On this page you can find all versions of the php package ivansostarko/otto-crypt-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package otto-crypt-php

OTTO Crypt — Laravel Package

OTTO Crypt is a Laravel‑ready crypto package that provides end‑to‑end encryption (E2EE) and chunked streaming AEAD for large files (video/audio), while remaining simple to use in apps and Artisan CLI.

⚠️ Security notice: OTTO Crypt uses trusted primitives (AES‑256‑GCM, Argon2id, HKDF, X25519), but its composition ("OTTO‑256‑GCM‑HKDF‑SIV") is custom. Treat it as experimental until it undergoes an independent cryptographic review.


Table of contents


Highlights


Installation

Requirements: PHP 8.2+, ext-openssl, ext-sodium, Laravel 12.


Quick start

CLI (Artisan)

Encrypt with a password (Argon2id):

Decrypt with a password:

End‑to‑end: encrypt to a recipient’s X25519 public key (base64/hex/raw):

End‑to‑end: decrypt with your X25519 secret key:

Laravel API (Facade)

Key exchange helpers:


Design & Format

Construction: OTTO‑256‑GCM‑HKDF‑SIV

Header layout

Binary header (fixed + variable):

Streaming/chunk format

For each plaintext chunk:

Each chunk is independently AEAD‑protected with its own derived nonce and the header as AD.

Key derivation

Nonce derivation (HKDF‑SIV style)

This provides deterministic per‑chunk nonces without persisting counters externally and protects against app‑level nonce reuse mistakes.

X25519 E2E mode


Configuration

config/otto-crypt.php (after publish):

Tune Argon2id for your hardware. Larger memory/time improves password resistance at a performance cost.


Comparison with other schemes

Scheme AEAD Nonce strategy Streaming E2E Handshake Notes
OTTO‑256‑GCM‑HKDF‑SIV AES‑256‑GCM Deterministic HKDF‑SIV nonces per chunk Yes (chunked) X25519 (ephemeral) Custom composition; audit recommended
AES‑256‑GCM (typical) AES‑256‑GCM Random/increment nonces (app‑managed) App‑defined App‑defined Easy to misuse via nonce reuse
AES‑SIV (RFC 5297) SIV (CMAC/HMAC) Deterministic; misuse‑resistant App‑defined App‑defined Slower; larger overhead; proven MR
ChaCha20‑Poly1305 ChaCha20‑Poly1305 App‑managed nonces App‑defined App‑defined Great on non‑AES‑NI CPUs
libsodium secretstream XChaCha20‑Poly1305 Internal (stateful) Yes App‑defined Excellent battle‑tested streaming API

Why OTTO? You need:

If you do not need AES or Laravel integration, consider libsodium’s crypto_secretstream (widely reviewed).


Threat model & security notes


Performance


Roadmap


FAQ

Q: Is OTTO Crypt FIPS compliant?
A: It uses OpenSSL’s AES‑GCM and HKDF, which may be FIPS‑validated depending on your OpenSSL build, but the overall construction is custom and not a NIST‑standard scheme.

Q: Can I rotate keys?
A: Yes. Re‑encrypt with a new recipient public key or password. The header binds parameters to ciphertext.

Q: Why not random nonces?
A: Random or monotonic nonces are fine if implemented perfectly. Deterministic HKDF‑derived nonces help avoid catastrophic accidental reuse in complex streaming/parallel code.

Q: Message vs file?
A: encryptString for small payloads; encryptFile for streaming large data (audio/video/files).

Q: Does this replace libsodium secretstream?
A: No. If you can use libsodium’s crypto_secretstream, it’s excellent. OTTO focuses on AES‑GCM, Laravel integration, and simple E2E helper flows.


Contributing

PRs welcome. Please include:

Before suggesting algorithmic changes, open an issue to discuss implications.


License

MIT © 2025 Ivan Sostarko


Responsible disclosure

If you discover a vulnerability, do not open a public issue. Email the maintainer privately (see composer.json author) with details and steps to reproduce. We’ll coordinate a fix and a responsible disclosure timeline.


All versions of otto-crypt-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-openssl Version *
ext-sodium Version *
illuminate/support Version ^10.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ivansostarko/otto-crypt-php contains the following files

Loading the files please wait ...