Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix for commonJS

Daniel Hougaard592271de3b81
diff --git a/backend/src/lib/crypto/encryption.ts b/backend/src/lib/crypto/encryption.ts
index 2c947b75bd..16a7f42e7c 100644
--- a/backend/src/lib/crypto/encryption.ts
+++ b/backend/src/lib/crypto/encryption.ts
@@ -8,6 +8,9 @@ import { SecretEncryptionAlgo, SecretKeyEncoding } from "@app/db/schemas";
import { getConfig } from "../config/env";
+export const decodeBase64 = (s: string) => naclUtils.decodeBase64(s);
+export const encodeBase64 = (u: Uint8Array) => naclUtils.encodeBase64(u);
+
export type TDecryptSymmetricInput = {
ciphertext: string;
iv: string;
diff --git a/backend/src/lib/crypto/index.ts b/backend/src/lib/crypto/index.ts
index be896a8bc4..0fe05bc012 100644
--- a/backend/src/lib/crypto/index.ts
+++ b/backend/src/lib/crypto/index.ts
@@ -1,13 +1,14 @@
export {
buildSecretBlindIndexFromName,
createSecretBlindIndex,
+ decodeBase64,
decryptAsymmetric,
decryptSymmetric,
decryptSymmetric128BitHexKeyUTF8,
+ encodeBase64,
encryptAsymmetric,
encryptSymmetric,
encryptSymmetric128BitHexKeyUTF8,
generateAsymmetricKeyPair
} from "./encryption";
export { generateSrpServerKey, srpCheckClientProof } from "./srp";
-export { decodeBase64, encodeBase64 } from "tweetnacl-util";