Exhub-vault provides an Emacs org-mode password vault feature integrated with the Exhub Elixir backend. Secrets are encrypted with AES-256-GCM on the server side and stored as org links in your org files, allowing you to manage sensitive information (API keys, passwords, tokens, etc.) directly within org-mode.
┌─────────────────────────────────────────────────────────┐
│ Emacs (org-mode) │
│ │
│ [[exhub-vault:BASE64_CIPHERTEXT][My GitHub Token]] │
│ │
│ C-c v i → insert secret │
│ C-c v c → decrypt & copy │
│ C-c v s → decrypt & show │
│ C-c C-o → follow link (decrypt & copy) │
└──────────────────────┬──────────────────────────────────┘
│ WebSocket
▼
┌─────────────────────────────────────────────────────────┐
│ Exhub (Elixir) │
│ │
│ Exhub.ResponseHandlers.ExhubVault │
│ ├─ encrypt: AES-256-GCM (SHA-256 of master password) │
│ └─ decrypt: AES-256-GCM │
│ │
│ Key source: SECRET_VAULT_PASSWORD (same as SecretVault)│
└─────────────────────────────────────────────────────────┘
SECRET_VAULT_PASSWORDmust be set (same password used by SecretVault for API keys)- Exhub backend running and WebSocket connected
(add-to-list 'load-path (expand-file-name "site-lisp/exhub" user-emacs-directory))
(require 'exhub-vault)
;; Enable vault keybindings globally
(exhub-vault-mode 1)
;; Or only in org-mode buffers
(add-hook 'org-mode-hook #'exhub-vault-mode)No additional configuration is needed. The vault reuses the existing SECRET_VAULT_PASSWORD:
export SECRET_VAULT_PASSWORD="your-master-password"M-x exhub-vault-insert-secret or C-c v i
- Enter a description (e.g., "GitHub Personal Access Token")
- Enter the secret value (input is hidden)
- An encrypted org link is inserted at point:
[[exhub-vault:RB3mVpLgrk8hN8xxCjtF8am2CBxD9faM6Gv7JP9e9thM][GitHub Personal Access Token]]
- On a vault link: Move point to the link and press
C-c C-o(org-open-at-point) orC-c v c - On selected text: Select the base64 ciphertext and press
C-c v c
The decrypted value is copied to the kill ring (clipboard).
M-x exhub-vault-decrypt-and-show or C-c v s
Displays the decrypted secret in the minibuffer without copying to clipboard.
* Secrets
** Development
[[exhub-vault:aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789abcdef][Gitee AI API Key]]
[[exhub-vault:ZyXwVuTsRqPoNmLkJiHgFeDcBa0987654321fedcba][OpenAI API Key]]
** Production
[[exhub-vault:AbCdEf0123456789GhIjKlMnOpQrStUvWxYz][Production DB Password]]
[[exhub-vault:Zy9876543210XwVuTsRqPoNmLkJiHgFeDcBa][AWS Access Key]]
| Key | Command | Description |
|---|---|---|
C-c v i |
exhub-vault-insert-secret |
Insert an encrypted secret as an org link |
C-c v c |
exhub-vault-decrypt-and-copy |
Decrypt vault link/region and copy to clipboard |
C-c v s |
exhub-vault-decrypt-and-show |
Decrypt vault link/region and show in minibuffer |
C-c C-o |
org-open-at-point |
On vault links: decrypt and copy to clipboard |
- Algorithm: AES-256-GCM (authenticated encryption)
- Key Derivation: SHA-256 hash of
SECRET_VAULT_PASSWORD→ 32-byte AES key - IV: Random 12-byte IV generated per encryption
- Format:
Base64(IV || Tag || Ciphertext) - Tag Length: 16 bytes (128 bits)
The same master password is used for both SecretVault (server-side API key storage) and the org-mode vault. Secrets encrypted with one cannot be decrypted without the correct password.
- The master password is never transmitted over WebSocket — only the encrypted ciphertext is sent
- Each encryption uses a unique random IV, so encrypting the same value twice produces different ciphertext
- AES-256-GCM provides both confidentiality and integrity (tamper detection)
- The org file stores only base64-encoded ciphertext — the plaintext never touches the disk in clear form
- Decrypted values are temporarily available in Emacs kill ring and minibuffer
Exhub.ResponseHandlers.ExhubVault— WebSocket handler forexhub-vaultencrypt/decrypt operationsExhub.Crypto.AesGcm— Shared AES-256-GCM primitives (key derivation, encrypt, decrypt); also used by the blink-search key-value store to encrypt values at restExhub.DefaultResponseHandler— Dispatchesexhub-vaultmessages to the vault handler
exhub-vault.el— Org-mode integration with org link support, keybindings, and vault commands