()
| 7 | const logger = createLogger('Encryption') |
| 8 | |
| 9 | function getEncryptionKey(): Buffer { |
| 10 | const key = env.ENCRYPTION_KEY |
| 11 | if (!key || key.length !== 64) { |
| 12 | throw new Error('ENCRYPTION_KEY must be set to a 64-character hex string (32 bytes)') |
| 13 | } |
| 14 | return Buffer.from(key, 'hex') |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Encrypts a secret using AES-256-GCM with the app's `ENCRYPTION_KEY`. |
no outgoing calls
no test coverage detected