@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.
- package/lib/cjs/app/CoreApp.js +4 -3
- package/lib/mjs/app/CoreApp.js +4 -3
- package/package.json +1 -1
- package/src/app/CoreApp.ts +5 -3
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -324,8 +324,9 @@ class CoreApp {
|
|
|
324
324
|
*/
|
|
325
325
|
decryptEnhanced(messageEncrypted, passphrase, durationSeconds) {
|
|
326
326
|
// Timestamp splitter
|
|
327
|
-
const pos = messageEncrypted.indexOf('
|
|
328
|
-
|
|
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 + '
|
|
419
|
+
return timestamp + '!' + this.encrypt(message, passphrase, iterations);
|
|
419
420
|
}
|
|
420
421
|
/**
|
|
421
422
|
* Enchance secret passphrase
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -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
|
-
|
|
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 + '
|
|
416
|
+
return timestamp + '!' + this.encrypt(message, passphrase, iterations);
|
|
416
417
|
}
|
|
417
418
|
/**
|
|
418
419
|
* Enchance secret passphrase
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -876,8 +876,10 @@ export abstract class CoreApp<
|
|
|
876
876
|
durationSeconds?: number
|
|
877
877
|
) {
|
|
878
878
|
// Timestamp splitter
|
|
879
|
-
const pos = messageEncrypted.indexOf('
|
|
880
|
-
|
|
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 + '
|
|
996
|
+
return timestamp + '!' + this.encrypt(message, passphrase, iterations);
|
|
995
997
|
}
|
|
996
998
|
|
|
997
999
|
/**
|