PHPackages                             drlaravel/lockryptic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. drlaravel/lockryptic

ActiveLibrary[File &amp; Storage](/categories/file-storage)

drlaravel/lockryptic
====================

A powerful PHP library for encrypting files and folders with secure execution capabilities

00PHP

Since Nov 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Drlaravel/Lockryptic)[ Packagist](https://packagist.org/packages/drlaravel/lockryptic)[ RSS](/packages/drlaravel-lockryptic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🔒 Lockryptic PHP Encryption Library
===================================

[](#-lockryptic-php-encryption-library)

[![Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)[![PHP](https://camo.githubusercontent.com/46a695f7a54c084f557b0c4d071535f93bc900c7f3c5555b72cee70a1ecd670c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d707572706c652e737667)](https://camo.githubusercontent.com/46a695f7a54c084f557b0c4d071535f93bc900c7f3c5555b72cee70a1ecd670c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d707572706c652e737667)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)

A powerful PHP library for encrypting files and folders with secure execution capabilities.

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Features](#-features)
- [System Requirements](#-system-requirements)
- [Installation](#-installation)
- [Quick Start](#-quick-start)
- [Usage Guide](#-usage-guide)
- [Security Considerations](#-security-considerations)
- [Architecture](#-architecture)
- [Contributing](#-contributing)
- [License](#-license)

✨ Features
----------

[](#-features)

- **🔐 Secure File Encryption**: Protect sensitive PHP files with strong encryption
- **📁 Folder Encryption**: Recursively encrypt entire directories
- **⚡ Secure Code Execution**: Run encrypted PHP files without exposing source code
- **⚙️ Configurable Settings**: Flexible configuration via `.env` file
- **📝 Detailed Logging**: Comprehensive logging of all operations
- **🛡️ Enterprise-Grade Security**: Uses industry-standard encryption algorithms

🛠️ System Requirements
----------------------

[](#️-system-requirements)

- PHP 7.4 or higher
- Composer
- OpenSSL extension
- File system write permissions

📥 Installation
--------------

[](#-installation)

1. **Clone the Repository**

    ```
    git clone https://github.com/Drlaravel/lockryptic.git
    cd lockryptic
    ```
2. **Install Dependencies**

    ```
    composer install
    ```
3. **Configure Environment**

    ```
    cp .env.example .env
    ```
4. **Generate Encryption Key**

    ```
    php generate_key.php
    ```

🚀 Quick Start
-------------

[](#-quick-start)

```
# 1. Encrypt a PHP file
php bin/console encrypt:file yourcode.php

# 2. Execute a function from encrypted file
php bin/console execute yourcode.enc.php functionName arg1 arg2

# Example with calculator function
php bin/console execute cal.enc.php cal 5 3
# Output: Result: 8
```

📖 Usage Guide
-------------

[](#-usage-guide)

### Command Reference

[](#command-reference)

#### 1. File Operations

[](#1-file-operations)

```
# Encrypt a single file
php bin/console encrypt:file source.php [encrypted.php]

# Decrypt a file (requires encryption key)
php bin/console decrypt:file encrypted.php [decrypted.php]
```

#### 2. Folder Operations

[](#2-folder-operations)

```
# Encrypt an entire folder
php bin/console encrypt:folder /path/to/source [/path/to/encrypted] --exclude=txt,log

# Decrypt a folder (requires encryption key)
php bin/console decrypt:folder /path/to/encrypted [/path/to/decrypted]
```

#### 3. Secure Execution

[](#3-secure-execution)

```
# Execute function from encrypted file
php bin/console execute encrypted.php functionName [arguments...]

# Example with multiple arguments
php bin/console execute math.enc.php calculate 10 20 "multiply"
```

### Project Structure

[](#project-structure)

```
lockryptic/
├── src/
│   ├── Commands/          # CLI Commands
│   │   ├── EncryptFileCommand.php
│   │   ├── DecryptFileCommand.php
│   │   ├── EncryptFolderCommand.php
│   │   ├── DecryptFolderCommand.php
│   │   └── ExecuteCommand.php
│   ├── Encryption/       # Encryption Logic
│   │   └── Encryptor.php
│   ├── Execution/        # Secure Execution
│   │   └── SecureLoader.php
│   └── Config/           # Configuration
│       └── Config.php
├── bin/
│   └── console          # CLI Entry Point
├── .env.example         # Environment Template
└── composer.json        # Dependencies
```

### Configuration Options

[](#configuration-options)

```
# .env file configuration options

# Your secure encryption key (generated)
ENCRYPTION_KEY=your_generated_key_here

# Encryption algorithm
ENCRYPTION_METHOD=AES-256-CBC

# Base directory for encrypted files
BASE_DIR=./encrypted_files

# Log file location
LOG_FILE=./encryption.log
```

🔒 Security Considerations
-------------------------

[](#-security-considerations)

### Key Management

[](#key-management)

- Store encryption keys securely
- Never commit `.env` file to version control
- Use different keys for development and production

### Best Practices

[](#best-practices)

- Regularly rotate encryption keys
- Backup encrypted files and keys separately
- Monitor access logs regularly
- Keep the library and dependencies updated

🏗️ Architecture
---------------

[](#️-architecture)

### Encryption Flow

[](#encryption-flow)

```
Source Code → Encryption → Encrypted File → Secure Execution
     ↑                                           ↓
  Developer                                    Users
```

### Security Model

[](#security-model)

```
┌─────────────────┐     ┌──────────────┐     ┌────────────────┐
│  Source Code    │ →   │  Encryption  │ →   │ Encrypted File │
└─────────────────┘     └──────────────┘     └────────────────┘
         ↑                     ↑                     ↓
    Developer Access     Encryption Key         User Access
         ↑                     ↑                     ↓
┌─────────────────┐     ┌──────────────┐     ┌────────────────┐
│   Full Access   │     │ Secure Key   │     │ Execute Only   │
└─────────────────┘     └──────────────┘     └────────────────┘
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please follow these steps:

1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

Made with ❤️ by DR Laravel

[Report Bug](https://github.com/Drlaravel/lockryptic/issues) · [Request Feature](https://github.com/Drlaravel/lockryptic/issues)

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4565e3452f4d21d82bf93dd40068807a2cdbd2eea74c115b40235e0d2a9ca2a?d=identicon)[Drlaravel](/maintainers/Drlaravel)

---

Top Contributors

[![Drlaravel](https://avatars.githubusercontent.com/u/137484894?v=4)](https://github.com/Drlaravel "Drlaravel (4 commits)")

### Embed Badge

![Health badge](/badges/drlaravel-lockryptic/health.svg)

```
[![Health](https://phpackages.com/badges/drlaravel-lockryptic/health.svg)](https://phpackages.com/packages/drlaravel-lockryptic)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
