Copy-paste friction
A key extracted from one pen won’t work when pasted into another pen with a different ID. This stops the laziest attacks.
Base64 is an encoding scheme, not encryption. It can be decoded by anyone without a key or password. The string reversal adds no meaningful cryptographic strength.
The salted key lives in your pen’s JavaScript, which is fully visible to anyone who views the pen source. Developer tools → Sources → your JS file → the salted key is right there.
SaltyKeys does not verify who is calling your API — only where the call originated (which pen ID was encoded). Anyone in your pen’s iframe can call SaltyKeys.getApiKey() from the console.
SaltyKeys has no interaction with the network. It cannot prevent cross-origin requests to your API if an attacker extracts the key.
Copy-paste friction
A key extracted from one pen won’t work when pasted into another pen with a different ID. This stops the laziest attacks.
Casual deterrence
Most developers skimming a pen’s source won’t immediately recognise a reversed Base64 string as an API key.
Educational value
Demonstrates context-binding, obfuscation techniques, and the limitations of client-side security.
✅ Good fit:
❌ Not appropriate:
Proper API key management requires a server:
┌─────────────┐ ┌─────────────────────────────────┐│ Browser │─────▶│ Your Server (API key is here) │─────▶ External API└─────────────┘ └─────────────────────────────────┘ No key here Key in environment variableServer-side best practices:
If you discover a vulnerability in SaltyKeys.js itself (e.g. the decode logic can be trivially bypassed in a way not already documented here), please report it via GitHub’s private vulnerability reporting rather than opening a public issue.
Note that “client-side code can be inspected in devtools” is not a vulnerability — it is the fundamental nature of JavaScript in a browser.