@etsoo/appscript 1.1.71 → 1.1.72

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.
@@ -324,8 +324,9 @@ class CoreApp {
324
324
  */
325
325
  decryptEnhanced(messageEncrypted, passphrase, durationSeconds) {
326
326
  // Timestamp splitter
327
- const pos = messageEncrypted.indexOf('+');
328
- if (pos === -1 || messageEncrypted.length <= 66)
327
+ const pos = messageEncrypted.indexOf('!');
328
+ // Miliseconds chars are longer than 8
329
+ if (pos < 8 || messageEncrypted.length <= 66)
329
330
  return undefined;
330
331
  const timestamp = messageEncrypted.substring(0, pos);
331
332
  if (durationSeconds != null && durationSeconds > 0) {
@@ -415,7 +416,7 @@ class CoreApp {
415
416
  // Timestamp
416
417
  const timestamp = shared_1.Utils.numberToChars(new Date().getTime());
417
418
  passphrase = this.encryptionEnhance(passphrase !== null && passphrase !== void 0 ? passphrase : this.passphrase, timestamp);
418
- return timestamp + '+' + this.encrypt(message, passphrase, iterations);
419
+ return timestamp + '!' + this.encrypt(message, passphrase, iterations);
419
420
  }
420
421
  /**
421
422
  * Enchance secret passphrase
@@ -321,8 +321,9 @@ export class CoreApp {
321
321
  */
322
322
  decryptEnhanced(messageEncrypted, passphrase, durationSeconds) {
323
323
  // Timestamp splitter
324
- const pos = messageEncrypted.indexOf('+');
325
- if (pos === -1 || messageEncrypted.length <= 66)
324
+ const pos = messageEncrypted.indexOf('!');
325
+ // Miliseconds chars are longer than 8
326
+ if (pos < 8 || messageEncrypted.length <= 66)
326
327
  return undefined;
327
328
  const timestamp = messageEncrypted.substring(0, pos);
328
329
  if (durationSeconds != null && durationSeconds > 0) {
@@ -412,7 +413,7 @@ export class CoreApp {
412
413
  // Timestamp
413
414
  const timestamp = Utils.numberToChars(new Date().getTime());
414
415
  passphrase = this.encryptionEnhance(passphrase !== null && passphrase !== void 0 ? passphrase : this.passphrase, timestamp);
415
- return timestamp + '+' + this.encrypt(message, passphrase, iterations);
416
+ return timestamp + '!' + this.encrypt(message, passphrase, iterations);
416
417
  }
417
418
  /**
418
419
  * Enchance secret passphrase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.1.71",
3
+ "version": "1.1.72",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -876,8 +876,10 @@ export abstract class CoreApp<
876
876
  durationSeconds?: number
877
877
  ) {
878
878
  // Timestamp splitter
879
- const pos = messageEncrypted.indexOf('+');
880
- if (pos === -1 || messageEncrypted.length <= 66) return undefined;
879
+ const pos = messageEncrypted.indexOf('!');
880
+
881
+ // Miliseconds chars are longer than 8
882
+ if (pos < 8 || messageEncrypted.length <= 66) return undefined;
881
883
 
882
884
  const timestamp = messageEncrypted.substring(0, pos);
883
885
 
@@ -991,7 +993,7 @@ export abstract class CoreApp<
991
993
  timestamp
992
994
  );
993
995
 
994
- return timestamp + '+' + this.encrypt(message, passphrase, iterations);
996
+ return timestamp + '!' + this.encrypt(message, passphrase, iterations);
995
997
  }
996
998
 
997
999
  /**