βββ βββ βββββββ βββββββββ βββ ββββββββββββββ βββ βββ βββ ββββββ βββ ββββββ βββββββββ
βββ βββββββββββ βββββββββ βββ ββββββββββββββββ ββββ βββ ββββββββββββββ ββββββ βββββββββ
βββ ββββββ ββββ βββ βββββββ ββββββ βββββββ βββ ββββββββββββββ ββββββ βββ
ββββ βββββββ βββ βββ βββββββ ββββββ βββββ ββββ βββββββββββββββ ββββββ βββ
βββββββ βββββββββ βββ βββ βββββββββββ βββ βββββββ βββ βββββββββββββββββββββββ
βββββ βββββββ βββ βββ βββββββββββ βββ βββββ βββ βββ βββββββ βββββββββββ
OMEGA PROTOCOL ACTIVE Β· AAD CONTEXT BINDING Β· ZERO PLAINTEXT STORAGE
This project is a Proof of Concept (PoC) and part of ongoing research and development at VisionGaia Technology. It is not a certified or production-ready product.
Use at your own risk. The software may contain security vulnerabilities, bugs, or unexpected behavior. It may break your environment if misconfigured or used improperly.
Do not deploy in critical production environments unless you have thoroughly audited the code and understand the implications. For enterprise-grade, verified protection, we recommend established and officially certified solutions.
Found a vulnerability or have an improvement? Open an issue or contact us.
V3.1.0 is a comprehensive hardening upgrade. Every change closes a concrete gap β no cosmetic version bumps.
| Area | V3.0.0 | V3.1.0 |
|---|---|---|
| Exception Handling | \RuntimeException |
VaultException β typed, catchable separately |
| Master Key Derivation | AUTH_SALT + SECURE_AUTH_KEY only |
All 8 WP salts + DB-generated fallback + wp_hash() anchor |
| Registry Integrity | No type checks | is_array() + is_string() guards β fatal-safe on DB corruption |
| Admin HTTP Headers | None | X-Frame-Options, X-Content-Type-Options, Referrer-Policy, X-XSS-Protection |
| Option Name Sanitizing | sanitize_text_field() (too permissive) |
preg_replace('/[^a-zA-Z0-9_\-]/', '') + enforced prefix namespace |
| Error Feedback | saved, deleted, error_crypto |
+ error_input, error_delete |
| Internationalization | None | Full esc_html_e() / __() / esc_js() coverage |
| API Usage | get_key('vis_api_key_groq') β full option name required |
get_key('groq_api_key') β prefix added internally |
| UI Display | Shows full prefix (vis_api_key_groq) |
Strips prefix β shows only identifier (groq_api_key) |
WordPress stores API keys in plaintext. Every plugin, every theme, every integration dumps credentials directly into wp_options β readable by anyone with database access.
VGT Key Vault closes this gap.
A cryptographic key management system that seals every API key with AES-256-GCM + AAD Context Binding before it ever touches the database. Even with full database access, an attacker retrieves nothing but cryptographically worthless ciphertext β mathematically bound to the key identifier.
Built as the cryptographic backbone of the VisionGaiaTechnology Sentinel ecosystem β and now available as a standalone open-source solution for any WordPress installation.
Standard WordPress Plugins:
API Key entered β stored as plaintext in wp_options
DB dump by attacker β all credentials compromised
Plugin stores key_value β readable by any other plugin
VGT Key Vault:
API Key entered β AES-256-GCM encrypted with AAD
DB dump by attacker β ciphertext only β worthless
Inter-plugin access β one authenticated API call
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VGT KEY VAULT PROTOCOL β
βββββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββββ€
β CRYPTO KERNEL β REGISTRY KERNEL β ADMIN KERNEL β
β β β β
β AES-256-GCM β O(1) Hash Map β Glassmorphism UI β
β GCM Auth Tag β Auto-Migration β Key Injection Form β
β AAD Binding β Auto-Heal β Vault Dashboard β
β HKDF + 8 Salts β Type Guards β Security Headers β
β Random IV β Index Registry β Delete with Nonce β
β wp_hash Anchor β β i18n Ready β
βββββββββββββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββββββββββ
Standard AES-256-GCM encrypts data. VGT Key Vault goes further with AAD (Additional Authenticated Data) β binding every ciphertext to its identifier:
WITHOUT AAD (standard encryption):
encrypt("sk-groq-xxx") β Ciphertext_A
Attacker copies Ciphertext_A to option "vis_api_key_other"
decrypt(Ciphertext_A) β "sk-groq-xxx" β (Ciphertext Swapping works)
WITH AAD (VGT Key Vault):
encrypt("sk-groq-xxx", context="vis_api_key_groq") β Ciphertext_A
Attacker copies Ciphertext_A to option "vis_api_key_other"
decrypt(Ciphertext_A, context="vis_api_key_other") β FAIL β
(GCM Authentication Tag mismatch β manipulation mathematically impossible)
This eliminates an entire class of credential-swapping attacks that most developers have never even heard of.
// Master Key Derivation β HKDF-SHA256 over ALL 8 WordPress salts
// Fallback: DB-generated salt if constants missing
// Final anchor: wp_hash() β plugin never fails on hardened configs
hash_hkdf('sha256', $combined_salts, 0, 'vgt_vault_master_domain', $auth_salt);
// Encryption with AAD Context Binding
Crypto_Engine::encrypt($api_key, $option_name);
// Decryption β verified against AAD (tamper detection built-in)
// Throws VaultException on mismatch β catchable separately from generic errors
Crypto_Engine::decrypt($ciphertext, $option_name);Key Architecture (V3.1.0):
- Master key derived via HKDF-SHA256 from all 8 WordPress salts β never stored
- DB-generated fallback salt β plugin functions even when
wp-config.phpconstants are absent or weak wp_hash()anchor β last-resort safety net on any hosting configuration- Every encryption uses a fresh random IV (
random_bytes) - GCM Authentication Tag appended β detects any modification
- AAD Context ID binds ciphertext to its exact storage location
- Typed
VaultExceptionβ catchable independently of generic\Exceptionhandlers
O(1) Hash Map instead of O(n) Array scan:
[ "vis_api_key_groq" => true ] β isset() lookup: O(1)
[ "vis_api_key_openai" => true ]
[ "vis_api_key_stripe" => true ]
Type Guards (V3.1.0):
is_array() check before iteration β fatal-safe on DB corruption
is_string() check on each entry β no PHP warnings on malformed data
Auto-Migration: Old array format detected β silently upgraded
Auto-Heal: Option missing from DB β removed from index automatically
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VGT Crypto Vault β
β AES-256-GCM Β· Context-Aware AAD Binding β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ€
β Key Injection β Active Cryptonodes (O(1)) β
β β β
β Identifier β groq_api_key [Term.] β
β [groq_api_key] β Hash: K7mX9pQr2nZ... β
β β β
β Plaintext Token β openai_api_key [Term.] β
β [sk-...] β Hash: Lp4vN8kJhFm... β
β β β
β [In Vault versiegeln]β β
ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
V3.1.0 Admin Hardening:
- Security Headers injected on every admin page render:
X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy: no-referrer,X-XSS-Protection: 0 - Strict option name sanitization:
preg_replace('/[^a-zA-Z0-9_\-]/', '')β special characters and injection attempts rejected at input - Enforced prefix namespace: all keys stored under
vis_api_key_internally β cross-namespace overwrites structurally impossible - UI strips prefix: dashboard displays
groq_api_key, notvis_api_key_groqβ cleaner, less error-prone - Extended error codes:
error_input(invalid identifier) anderror_delete(deletion failed) in addition toerror_crypto - Full i18n coverage: all output via
esc_html_e()/__()/esc_js()β translation-ready, XSS-safe - Nonce verification on all POST requests
manage_optionscapability check before any operation- Confirmation dialog before key termination
V3.1.0 simplifies the API. Pass only the identifier β the prefix is handled internally.
use VGT\Vault\API;
// V3.0.0 (deprecated pattern β full option name required)
$api_key = API::get_key('vis_api_key_groq');
// V3.1.0 (current β identifier only, prefix added internally)
$api_key = API::get_key('groq_api_key');
// VaultException β typed, catchable separately
try {
$key = API::get_key('stripe_api_key');
} catch (\VGT\Vault\VaultException $e) {
// Key missing, tampered, or decryption failed
}No plaintext ever stored. No raw option access. One secure interface.
PHP: 8.0+
WordPress: 6.0+
OpenSSL: enabled (standard on all hosting)
1. Upload & Activate:
WordPress Admin β Plugins β Upload Plugin β ZIP β Install β Activate
2. Store your first API key:
WordPress Admin β VGT Vault β Key Injection
Identifier: groq_api_key
Plaintext Token: sk-your-key-here
β [In Vault versiegeln]
3. Use in your plugin:
$key = \VGT\Vault\API::get_key('groq_api_key');| Feature | Standard wp_options |
VGT Key Vault |
|---|---|---|
| Database encryption | β Plaintext | β AES-256-GCM |
| Ciphertext Swapping protection | β | β AAD Context Binding |
| Key derivation | β Raw storage | β HKDF-SHA256 over all 8 WP salts |
| Fallback on missing salts | β Fatal / empty key | β
DB salt + wp_hash() anchor |
| Tamper detection | β | β GCM Auth Tag |
| O(1) Registry lookup | β | β Hash Map |
| CSRF protection | β | β
wp_verify_nonce |
| Option name injection prevention | β | β Strict regex + prefix namespace |
| Admin clickjacking protection | β | β
X-Frame-Options: DENY |
| MIME sniffing protection | β | β
X-Content-Type-Options: nosniff |
| Typed exception handling | β | β
VaultException |
| Registry fatal-safety | β | β Type guards on DB read |
| Inter-plugin API | β | β Typed facade, prefix-transparent |
| i18n / translation ready | β | β
Full __() / esc_html_e() coverage |
| DB dump resistance | β Full compromise | β Ciphertext only |
vgt-key-vault/
βββ vgt-key-vault.php β single-file plugin
β
βββ Inline Kernels:
βββ Crypto_Engine β AES-256-GCM + AAD + HKDF (8 salts + fallback)
βββ Vault_Registry β O(1) Hash Map + Type Guards + Auto-Migration
βββ Admin_Dashboard β UI + Security Headers + i18n + nonce handlers
βββ VaultException β Typed exception class
βββ API β inter-plugin facade (prefix-transparent)
No external dependencies. No composer. No build step. One PHP file. Drop it in and it works.
β οΈ VGT Key Vault derives its master key from all 8 WordPress salts.
If you change any salt constant in wp-config.php,
ALL stored ciphertexts become permanently unreadable.
Before migration or salt rotation:
1. Decrypt and export all keys from the Vault Dashboard
2. Rotate salts in wp-config.php
3. Re-import keys into the new Vault instance
Note: If wp-config.php constants are absent or empty,
V3.1.0 automatically falls back to a DB-stored salt and wp_hash().
The plugin will not crash on hardened or non-standard configurations.
Pull requests are welcome. For major changes, please open an issue first.
git clone https://github.com/VisionGaiaTechnology/wpkeyvault
cd vgt-key-vaultFound a vulnerability? Report via the VGT Sentinel Operative Registry β responsible disclosure is rewarded.
VGT Key Vault is free and open-source under AGPLv3. If it saved you time, money, or a security incident β consider supporting:
AGPLv3 License Β· Β© 2026 VisionGaia Technology Β· Cologne, Germany
Anyone using and modifying this plugin must publish changes under AGPLv3. Commercial use permitted. Attribution required.