@etsoo/appscript 1.1.74 → 1.1.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -321,11 +321,14 @@ class CoreApp {
321
321
  hasher: crypto_js_1.algo.SHA256,
322
322
  iterations: 1000 * iterations
323
323
  });
324
- return crypto_js_1.AES.decrypt(encrypted, key, {
324
+ const bytes = crypto_js_1.AES.decrypt(encrypted, key, {
325
325
  iv,
326
326
  padding: crypto_js_1.pad.Pkcs7,
327
327
  mode: crypto_js_1.mode.CBC
328
- }).toString(crypto_js_1.enc.Utf8);
328
+ });
329
+ if (bytes.words.length == 0)
330
+ return undefined;
331
+ return bytes.toString(crypto_js_1.enc.Utf8);
329
332
  }
330
333
  /**
331
334
  * Enhanced decrypt message
@@ -318,11 +318,14 @@ export class CoreApp {
318
318
  hasher: algo.SHA256,
319
319
  iterations: 1000 * iterations
320
320
  });
321
- return AES.decrypt(encrypted, key, {
321
+ const bytes = AES.decrypt(encrypted, key, {
322
322
  iv,
323
323
  padding: pad.Pkcs7,
324
324
  mode: mode.CBC
325
- }).toString(enc.Utf8);
325
+ });
326
+ if (bytes.words.length == 0)
327
+ return undefined;
328
+ return bytes.toString(enc.Utf8);
326
329
  }
327
330
  /**
328
331
  * Enhanced decrypt message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.1.74",
3
+ "version": "1.1.75",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -870,11 +870,14 @@ export abstract class CoreApp<
870
870
  iterations: 1000 * iterations
871
871
  });
872
872
 
873
- return AES.decrypt(encrypted, key, {
873
+ const bytes = AES.decrypt(encrypted, key, {
874
874
  iv,
875
875
  padding: pad.Pkcs7,
876
876
  mode: mode.CBC
877
- }).toString(enc.Utf8);
877
+ });
878
+ if (bytes.words.length == 0) return undefined;
879
+
880
+ return bytes.toString(enc.Utf8);
878
881
  }
879
882
 
880
883
  /**