feat(server): add global encryption module (AES-256-GCM) (#2400)

Provides an injectable EncryptionService that encrypts/decrypts strings
with AES-256-GCM using a key derived from APP_SECRET with domain
separation.
This commit is contained in:
Philip Okugbe
2026-08-16 12:35:37 +01:00
committed by GitHub
parent d136864ef1
commit 911c1057d6
5 changed files with 316 additions and 0 deletions
@@ -0,0 +1,13 @@
export class UnableToInitialize extends Error {
constructor(message: string) {
super(`Unable to initialize the encryption service: ${message}`);
this.name = 'UnableToInitialize';
}
}
export class UnableToDecrypt extends Error {
constructor(reason: string) {
super(`Unable to decrypt the ciphertext: ${reason}`);
this.name = 'UnableToDecrypt';
}
}