vigihdev/crypto-dev
Composer 安装命令:
composer require vigihdev/crypto-dev
包简介
Vigih dev crypto
README 文档
README
Library PHP untuk enkripsi dan dekripsi menggunakan OpenSSL dan Defuse Crypto.
Features
- ✅ OpenSSL encryption/decryption
- ✅ Defuse Crypto encryption/decryption
- ✅ Console commands untuk key generation
- ✅ Environment variable encryption
- ✅ Secure key storage
Installation
composer install
Usage
Generate Keys
# Generate OpenSSL key php console.php openssl generateKey # Generate Defuse key php console.php defuse generateKey
Encrypt Environment Variables
# OpenSSL php console.php openssl writeEnvEncrypt --DB_PASSWORD=secret123 # Defuse php console.php defuse writeEnvEncrypt --API_KEY=myapikey
Test Decryption
# OpenSSL php console.php openssl testDecrypt "encrypted_string" # Defuse php console.php defuse testDecrypt "encrypted_string"
Directory Structure
src/
├── Console/ # Console commands
├── Exception/ # Custom exceptions
├── CryptoOpenssl.php # OpenSSL crypto class
└── CryptoDefuse.php # Defuse crypto class
config/
└── secrets/ # Key storage (auto-created)
tests/ # Unit tests
Security
- Keys disimpan dengan permission 0600
- Secrets directory dengan permission 0700
- Gunakan environment variables untuk sensitive data
Requirements
- PHP 8.0+
- OpenSSL extension
- Defuse/php-encryption
Author
Vigih Dev
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-01