Download the PHP package kodhe/encryption without Composer
On this page you can find all versions of the php package kodhe/encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kodhe/encryption
More information about kodhe/encryption
Files in kodhe/encryption
Download kodhe/encryption
More information about kodhe/encryption
Files in kodhe/encryption
Vendor kodhe
Package encryption
Short Description Refactored Encryption Library for CodeIgniter 3 with PSR-4/PSR-12 compliance
License MIT
Package encryption
Short Description Refactored Encryption Library for CodeIgniter 3 with PSR-4/PSR-12 compliance
License MIT
Please rate this library. Is it a good library?
Informations about the package encryption
Kodhe Encryption Library for CodeIgniter 3
Refactored Encryption Library for CodeIgniter 3 with PSR-4/PSR-12 compliance, modern design patterns, and comprehensive test coverage.
Features
- PSR-4 Autoloading: Proper namespace-based autoloading
- PSR-12 Coding Style: Modern PHP coding standards
- Strategy Pattern: Pluggable encryption handlers (OpenSSL, etc.)
- Dependency Injection: Easy to test and extend
- Caching: Cipher algorithm resolution caching for performance
- Authenticated Encryption: Support for GCM mode and CBC+HMAC
- Batch Operations:
encrypt_many()anddecrypt_many()for bulk operations - Full Backward Compatibility: Drop-in replacement for CI3's native Encryption library
Installation
Via Composer
Manual Installation
-
Copy the
src/folder to your application: - Add PSR-4 autoloading to your
application/config/config.php:
Usage
Basic Usage (CI3 Compatible)
With Custom Configuration
Using Raw Binary Data
Batch Operations
Key Generation
Configuration
Add to application/config/config.php:
Optional: Create application/config/encryption.php:
API Reference
Main Methods
| Method | Description | Parameters |
|---|---|---|
encrypt($data, $params = null) |
Encrypt data | $data: string, $params: array (optional) |
decrypt($data, $params = null) |
Decrypt data | $data: string, $params: array (optional) |
initialize($params) |
Initialize/reconfigure | $params: array |
create_key($length) |
Generate random key | $length: int (bytes) |
hkdf($key, $digest, $salt, $length, $info) |
Derive key | See HKDF RFC 5869 |
encrypt_many($items, $params) |
Batch encrypt | $items: array, $params: array |
decrypt_many($items, $params) |
Batch decrypt | $items: array, $params: array |
Parameter Options
Running Tests
Project Structure
Requirements
- PHP 7.4+ or 8.x
- OpenSSL extension
- Hash extension
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make changes with tests
- Ensure all tests pass
- Submit a pull request
Changelog
Version 2.0.0
- Complete refactor with PSR-4/PSR-12 compliance
- Strategy pattern for encryption handlers
- Dependency injection for better testability
- Caching for cipher algorithm resolution
- Batch operations support
- Comprehensive unit tests
- Full backward compatibility with CI3 API
All versions of encryption with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.4|^8.0
ext-openssl Version *
ext-hash Version *
ext-openssl Version *
ext-hash Version *
The package kodhe/encryption contains the following files
Loading the files please wait ...