91ahmed/secure-cogs

SecureCogs is a PHP data storage package that allows you to store data in an encrypted key-value pair format, providing various methods to simplify data accessibility and maintainability.

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/91ahmed/secure-cogs

v1.0 2025-01-06 21:50 UTC

This package is auto-updated.

Last update: 2025-12-05 13:42:59 UTC


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

composer require 91ahmed/secure-cogs

Usage Example

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

$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');