Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/lib/api-key/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export async function decryptApiKey(encryptedValue: string): Promise<{ decrypted
const authTag = Buffer.from(authTagHex, 'hex')

try {
const decipher = createDecipheriv('aes-256-gcm', key, iv)
const decipher = createDecipheriv('aes-256-gcm', key, iv, { authTagLength: 16 })
decipher.setAuthTag(authTag)

let decrypted = decipher.update(encrypted, 'hex', 'utf8')
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/lib/core/security/encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function decryptSecret(encryptedValue: string): Promise<{ decrypted
const authTag = Buffer.from(authTagHex, 'hex')

try {
const decipher = createDecipheriv('aes-256-gcm', key, iv)
const decipher = createDecipheriv('aes-256-gcm', key, iv, { authTagLength: 16 })
decipher.setAuthTag(authTag)

let decrypted = decipher.update(encrypted, 'hex', 'utf8')
Expand Down
2 changes: 1 addition & 1 deletion packages/db/scripts/migrate-block-api-keys-to-byok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function decryptSecret(encryptedValue: string): Promise<string> {
const iv = Buffer.from(ivHex, 'hex')
const authTag = Buffer.from(authTagHex, 'hex')

const decipher = createDecipheriv('aes-256-gcm', key, iv)
const decipher = createDecipheriv('aes-256-gcm', key, iv, { authTagLength: 16 })
decipher.setAuthTag(authTag)

let decrypted = decipher.update(encrypted, 'hex', 'utf8')
Expand Down