Skip to content

Harden embedded catalog credential encoding - #124

Open
mitch030504 wants to merge 1 commit into
DeliciousMeatPop:mainfrom
mitch030504:pr/catalog-key-envelope
Open

mitch030504 wants to merge 1 commit into
DeliciousMeatPop:mainfrom
mitch030504:pr/catalog-key-envelope

Conversation

@mitch030504

Copy link
Copy Markdown

Summary

Replace the fixed XOR mask used to embed the vrSrc catalog credential with a versioned AES-256-GCM envelope.

  • Each build gets a random 16-byte salt and 12-byte nonce.
  • The payload is authenticated with GCM, so a tampered bundle fails instead of yielding a corrupt key.
  • The format is versioned as fcbk1:<salt>:<nonce>:<tag+ciphertext> in base64url.
  • A plaintext string search no longer finds the credential, and one extracted decoder no longer decodes every build with the same mask.

Security scope

This is obfuscation, not secrecy. The decoder ships with the app and the key is recoverable from a running process. The comment in src/shared/keyObfuscation.ts says so explicitly. The change only raises the cost of lifting the embedded credential from a released bundle.

Tests

src/shared/keyObfuscation.test.ts covers round-trip decoding, per-build uniqueness, absence of plaintext, tamper rejection, and unsupported/malformed formats.

npm test passes with the new tests. The branch is based on upstream main at v1.9.0.

Replace the fixed XOR mask with a versioned AES-256-GCM envelope that uses a
random salt and nonce per build. A plain string search no longer reveals the
key, and one extracted decoder no longer decodes every build with the same
mask.

The payload authenticates with GCM, so a tampered bundle fails instead of
producing a corrupt key. Tests cover round-trip, per-build uniqueness,
plaintext absence, tampering and unknown formats.

This remains obfuscation, not secrecy: the decoder ships with the app and the
key is recoverable from a running process. See the comment in
src/shared/keyObfuscation.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant