@thezelijah/majik-message 1.0.9 → 1.0.10
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/dist/majik-message.js +5 -2
- package/package.json +2 -1
package/dist/majik-message.js
CHANGED
|
@@ -335,7 +335,6 @@ export class MajikMessage {
|
|
|
335
335
|
*/
|
|
336
336
|
async decryptEnvelope(envelope, bypassIdentity = false) {
|
|
337
337
|
const fingerprint = envelope.extractFingerprint();
|
|
338
|
-
console.log("Fingerprint: ", fingerprint);
|
|
339
338
|
const authorizedAccount = this.listContacts(true).find((a) => a.fingerprint === fingerprint);
|
|
340
339
|
if (!authorizedAccount) {
|
|
341
340
|
throw new Error("No matching own account to decrypt this envelope");
|
|
@@ -365,10 +364,14 @@ export class MajikMessage {
|
|
|
365
364
|
else {
|
|
366
365
|
decrypted = await EncryptionEngine.decryptSoloMessage(envelope.extractEncryptedPayload(), privateKey);
|
|
367
366
|
}
|
|
367
|
+
let plaintext = decrypted;
|
|
368
|
+
if (decrypted.startsWith("mjkcmp:")) {
|
|
369
|
+
plaintext = (await MajikCompressor.decompress("plaintext", decrypted));
|
|
370
|
+
}
|
|
368
371
|
await this.envelopeCache.set(envelope, typeof window !== "undefined" && window.location
|
|
369
372
|
? window.location.hostname
|
|
370
373
|
: "extension");
|
|
371
|
-
return
|
|
374
|
+
return plaintext;
|
|
372
375
|
}
|
|
373
376
|
async importContactFromString(base64Str) {
|
|
374
377
|
const jsonStr = base64ToUtf8(base64Str);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@thezelijah/majik-message",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Encrypt and decrypt messages on any website. Secure chats with keypairs and seed-based accounts. Open source.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.10",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"@stablelib/random": "^2.0.1",
|
|
85
85
|
"@stablelib/sha256": "^2.0.1",
|
|
86
86
|
"@stablelib/x25519": "^2.0.1",
|
|
87
|
+
"@thezelijah/majik-message": "^1.0.9",
|
|
87
88
|
"ed2curve": "^0.3.0",
|
|
88
89
|
"fernet": "^0.3.3",
|
|
89
90
|
"fflate": "^0.8.2",
|