fix(security): encrypt API key in config file (#100) - #128
Closed
duongynhi000005-oss wants to merge 1 commit into
Closed
duongynhi000005-oss wants to merge 1 commit into
duongynhi000005-oss wants to merge 1 commit into
Conversation
The openrouter_api_key was stored as plaintext in ~/.bytebell/config.json. Any process running as the same OS user could read it with a single . Now encrypts sensitive fields (openrouter_api_key, neo4j_password) using AES-256-GCM with a machine-derived key before writing to disk. - Added crypto.ts with encrypt/decrypt functions - Writer encrypts sensitive fields before saving - Loader decrypts on read - Backward compatible with existing plaintext configs Fixes #100
bharatsachya
self-requested a review
June 5, 2026 09:13
bharatsachya
self-requested a review
June 5, 2026 10:52
bharatsachya
suggested changes
Jun 5, 2026
bharatsachya
left a comment
Contributor
There was a problem hiding this comment.
Hi!! Great Attempt but this won't work in opensource look into this PR that i have added in review you will be able to find that we can use features of macos and windows and do not have to worry about encryption
Other things encryption won't work as our code is public and this makes you code vulenrable of attack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #100## Problem
openrouter_api_keyis stored as plaintext in~/.bytebell/config.json. Any process running as the same OS user can read it.## SolutionEncrypts sensitive fields using AES-256-GCM with a machine-derived key before writing to disk.### Changes:-packages/config/src/crypto.ts(new): Encryption/decryption using node:crypto-packages/config/src/writer.ts: Encrypts sensitive fields before save-packages/config/src/loader.ts: Decrypts on read- Backward compatible with existing plaintext configs