https://github.com/91ahmed/securecogs
Securely storing system data and configurations in encrypted files, ensuring quick access and prevent unauthorized access.
https://github.com/91ahmed/securecogs
php-config php-config-parser php-configuration php-data-storage
Last synced: 23 days ago
JSON representation
Securely storing system data and configurations in encrypted files, ensuring quick access and prevent unauthorized access.
- Host: GitHub
- URL: https://github.com/91ahmed/securecogs
- Owner: 91ahmed
- License: mit
- Created: 2025-01-06T21:45:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-05T13:42:55.000Z (4 months ago)
- Last Synced: 2025-12-08T23:59:19.047Z (4 months ago)
- Topics: php-config, php-config-parser, php-configuration, php-data-storage
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SecureCogs is a PHP package for securely storing application data as encrypted key-value pairs, ideal for storing (credentials, secrets, tokens).
## Features
* Encrypted key-value storage in flat files.
* Customizable encryption algorithm, key, and IV.
* Returns data as PHP array — easy to integrate.
* No external dependencies beyond standard PHP + composer autoload.
#### Composer Installation
``` bash
composer require 91ahmed/secure-cogs
```
#### Usage Example
``` php
require 'vendor/autoload.php';
// Create (or load) a config file (filename without extension)
$config = new \SecureCogs\Cogs("path/to/secure_config");
// Set a new key-value pair
$config->set('key', 'value');
// Update an existing key
$config->edit('key', 'new value');
// Delete a key
$config->delete('key');
// Get all stored data (decrypted)
$data = $config->data();
print_r($data);
```
#### Advanced: Custom Encryption Method
``` php
$config = new \SecureCogs\Cogs("path/to/secure_config");
// Change encryption settings
$config->method('AES-256-CBC');
$config->key('your-very-strong-key-here');
$config->iv('your-initialization-vector');
```