drlaravel/lockryptic 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drlaravel/lockryptic

Composer 安装命令:

composer require drlaravel/lockryptic

包简介

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

README 文档

README

Version PHP License

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

📋 Table of Contents

✨ 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

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

📥 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

# 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

Command Reference

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

# 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

# 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

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

# .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

Key Management

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

Best Practices

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

🏗️ Architecture

Encryption Flow

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

Security Model

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

🤝 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

This project is licensed under the MIT License - see the LICENSE file for details.

Made with ❤️ by DR Laravel

Report Bug · Request Feature

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-20