DEV Community

ELMAN MOHAMMADI
ELMAN MOHAMMADI

Posted on

Encryption-tool: An Open-Source PHP Project for Secure File Encryption and Encrypted Package Management

I've been developing Encryption-tool, an open-source PHP project designed to make file encryption, encrypted package management, and secure data transfer more reliable.

Rather than treating encryption as a simple operation that turns a file into ciphertext, the project focuses on the entire lifecycle of an encrypted package: key derivation, authenticated encryption, package integrity, input validation, decryption, and safe file restoration.

Some of the key technical components include:

  • Argon2id for password-based key derivation: Password-derived keys are computationally expensive to guess, making offline password guessing more costly. This raises the cost of attacks but does not eliminate the risk of weak passwords.
  • XChaCha20-Poly1305 authenticated encryption: Encryption is designed to provide confidentiality and detect unauthorized modification of protected data.
  • Randomized root-key architecture: The V14 design uses a randomly generated root key as part of its key-management approach.
  • Chunked encryption: The streaming design authenticates chunk-related context, including chunk indexes, to help detect invalid or manipulated chunk sequences.
  • Encrypted manifests and package integrity: Package metadata is protected, while integrity-oriented mechanisms help validate package contents.
  • Strict input and header validation: Package parsing is designed to reject unexpected or malformed structures rather than blindly trusting input.
  • Safer file restoration: Restoration behavior is designed to avoid silently overwriting existing files.

I'm currently working on hardening and stabilizing the implementation toward a dependable 1.0.0 release. That means focusing not only on the cryptographic primitives, but also on failure handling, malformed and corrupted inputs, regression testing, and ensuring that encryption and decryption behave consistently.

An important distinction: using established cryptographic algorithms does not automatically make an entire application secure. The surrounding implementation, key management, file handling, and threat model all matter. I'm interested in identifying weaknesses and edge cases before calling the project stable, rather than making claims that it is unbreakable.

I'd particularly appreciate technical feedback on the package format, key-management design, password-guessing resistance, authenticated chunk processing, and safe restoration behavior.

Repository: https://github.com/ElmanCod110/Encryption-tool

Top comments (0)