From 83e70a43221bde77365d7a5558fa4ec78593a16a Mon Sep 17 00:00:00 2001 From: cirroskais Date: Fri, 26 Jul 2024 01:13:47 -0400 Subject: [PATCH] ??? --- Dockerfile | 3 +-- src/lib/encryption.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 49bee77..2737bce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM oven/bun:1 as base +FROM oven/bun as base WORKDIR /usr/src/app FROM base AS install @@ -19,5 +19,4 @@ COPY --from=prerelease /usr/src/app/build/garf-api . USER bun EXPOSE 3000/tcp -RUN ls -lah CMD [ "./garf-api" ] diff --git a/src/lib/encryption.ts b/src/lib/encryption.ts index 6fc2428..f36568b 100644 --- a/src/lib/encryption.ts +++ b/src/lib/encryption.ts @@ -14,7 +14,7 @@ function scryptAsync(password: string, length: number) { export async function encrypt(data: string) { const iv = randomBytes(16); - const cipher = createCipheriv("aes-256-ccm", KEY, iv); + const cipher = createCipheriv("aes-256-cbc", KEY, iv); let encrypted = cipher.update(data, "utf8", "base64url"); encrypted += cipher.final("base64url"); @@ -24,7 +24,7 @@ export async function encrypt(data: string) { export async function decrypt(data: string, iv: string) { const ivBuf = Buffer.from(iv, "hex"); - const decipher = createDecipheriv("aes-256-ccm", KEY, ivBuf); + const decipher = createDecipheriv("aes-256-cbc", KEY, ivBuf); let decrypted = decipher.update(data, "base64url", "utf-8"); try {