perf: centralized and memoized AES-256-GCM cryptographic helper library (#51)#71
Conversation
|
@prakshithamalla-art is attempting to deploy a commit to the Deekshith Gowda HS's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthrough
ChangesEncryption Module Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #51
🎯 Overview & Motivation
The processing workflows for runtime secrets and application credentials relied on scattered local crypto instances or lacked clear key error verification bounds. This resulted in redundant memory allocation during heavy sandbox synchronization loops.
This PR centralizes the application's cryptographic infrastructure inside a singular utility file (
lib/crypto.ts) using high-performance symmetricaes-256-gcmalgorithms, while adding dynamic allocation caching for the key buffers.🛠️ Changes Implemented
lib/crypto.ts.cachedKeyBuffermemoization variables to eliminate repetitiveBuffer.fromstring evaluations on hot execution paths.iv:authTag:encryptedData) with strict runtime validations forENCRYPTION_KEYavailability.Summary by CodeRabbit
ENCRYPTION_KEY