Skip to content

91ahmed/SecureCogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Securely storing system data and configurations in encrypted files, ensuring quick access and prevent unauthorized access.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages