feat: add encryption helper utilities and base64 module #49
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.
Summary
lib/crypto-utils.ts
for simplified gist encryption/decryptionlib/base64.ts
to eliminate redundant implementationsWhat's included
Encryption Helper Utilities (
crypto-utils.ts
)encryptGist()
- High-level function to encrypt files with metadata handlingdecryptGist()
- Simplified gist decryption with key handlinggenerateShareableUrl()
- Create shareable URLs with encryption keysextractKeyFromUrl()
- Extract keys from URL fragmentsvalidateGistPin()
- PIN validation for gist editingcreateGist()
- Complete gist creation with shareable URLsloadGistFromUrl()
- Load and decrypt gists from URLsBase64 Module (
base64.ts
)base64Encode/Decode
- Standard base64 for internal storagebase64UrlEncode/Decode
- URL-safe base64 for keys in URLsisValidBase64()
- Validation utilityCode Improvements
Test plan
npm test
npm run typecheck
npm run lint
Closes #40
🤖 Generated with Claude Code