Handling Secrets: The Ghost Crypto Utility

📘 General javascript v1

The client-side `ghostCrypto` utility provides baseline encryption and obfuscation tools to the Vue SPA, ensuring token masking and secure storage formatting prior to sending data to the cloud or local Engine.

Front-Line Sanitization

Flowork handles a significant amount of sensitive data: API Keys for Gmail, Cloudflare API tokens for licenses, and Web3 Wallet secrets.

While the Go Engine houses the actual "Credential Vault" using real AES-256 block ciphers, the frontend Vue application still manipulates this data in RAM.

The Utility Package

The src/utils/ghostCrypto.js library provides standard sanitization.

  • Masking: When rendering the Credentials layout, the raw keys should never be visible to screen sharing or casual over-the-shoulder glance. The maskKey() function compresses outputs for safety.
  • Base64 Toggling: Because WebSockets (Port 5001) prefer raw string payloads, image buffers captured by the AI from bView.webContents.capturePage() must be encoded and decoded rapidly without native Buffer support.
  • Storage Salting: As a baseline defense, User Preference configs that store soft secrets in localStorage are lightly obfuscated.
This layer of "fast cryptography" protects the Vue application state from simple exploits before invoking the heavy machinery of the Go Engine.