Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

crypto: force convert IV to urlsafe base64 variant

Abdullah Atta9bae058d160f
diff --git a/packages/crypto/src/decryption.ts b/packages/crypto/src/decryption.ts
index 04a9bda87..185bce559 100644
--- a/packages/crypto/src/decryption.ts
+++ b/packages/crypto/src/decryption.ts
@@ -67,7 +67,10 @@ export default class Decryption {
null,
input,
null,
- from_base64(cipherData.iv),
+ from_base64(
+ cipherData.iv.replace(/\//g, "_").replace(/\+/g, "-"),
+ base64_variants.URLSAFE_NO_PADDING
+ ),
encryptionKey.key
);