@majikah/majik-message 0.1.18 → 0.1.19

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Developed by Zelijah](https://img.shields.io/badge/Developed%20by-Zelijah-red?logo=github&logoColor=white)](https://thezelijah.world) ![GitHub Sponsors](https://img.shields.io/github/sponsors/jedlsf?style=plastic&label=Sponsors&link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fjedlsf)
4
4
 
5
5
 
6
- **Majik Message** is a secure messaging platform built on cryptographic identity. Your account *is* your encryption keys—no phone numbers, no passwords, just your 12-word seed phrase and complete privacy.
6
+ **Majik Message** is a post-quantum secure messaging platform built on cryptographic identity. Your account *is* your encryption keys—no phone numbers, no passwords, just your 12-word seed phrase and complete privacy. Safe from quantum computers.
7
7
 
8
8
  ![npm](https://img.shields.io/npm/v/@majikah/majik-message) ![npm downloads](https://img.shields.io/npm/dm/@majikah/majik-message) ![npm bundle size](https://img.shields.io/bundlephobia/min/%40majikah%2Fmajik-message) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)
9
9
 
@@ -36,11 +36,12 @@ Also available on [Google Chrome Web Store](https://chromewebstore.google.com/de
36
36
  - [Overview](#overview)
37
37
  - [What Makes Majik Message Different](#what-makes-majik-message-different)
38
38
  - [Key Features](#key-features)
39
- - [End-to-End Encryption](#end-to-end-encryption)
40
- - [Seed Phrase–Based Identity](#seed-phrasebased-identity)
39
+ - [Post-Quantum End-to-End Encryption](#post-quantum-end-to-end-encryption)
40
+ - [Seed Phrase–Based Hybrid Identity](#seed-phrasebased-hybrid-identity)
41
41
  - [Offline Operation](#offline-operation)
42
42
  - [Realtime Messaging (Free for Everyone)](#realtime-messaging-free-for-everyone)
43
43
  - [Group Messaging](#group-messaging)
44
+ - [Emoji and GIF Support](#emoji-and-gif-support)
44
45
  - [Persistent Message Threads](#persistent-message-threads)
45
46
  - [Message Expiration Timer](#message-expiration-timer)
46
47
  - [Encrypted Message Export](#encrypted-message-export)
@@ -48,11 +49,11 @@ Also available on [Google Chrome Web Store](https://chromewebstore.google.com/de
48
49
  - [Multi-Account Support](#multi-account-support)
49
50
  - [Chrome Extension](#chrome-extension)
50
51
  - [How It Works](#how-it-works)
51
- - [Account Creation](#account-creation)
52
- - [Sending an Encrypted Message](#sending-an-encrypted-message)
52
+ - [Account Creation (Hybrid Keypair Derivation)](#account-creation-hybrid-keypair-derivation)
53
+ - [Sending a Post-Quantum Encrypted Message](#sending-a-post-quantum-encrypted-message)
53
54
  - [For Solo Messages (sender-only):](#for-solo-messages-sender-only)
54
55
  - [For Group Messages (2+ recipients):](#for-group-messages-2-recipients)
55
- - [Receiving and Decrypting a Message](#receiving-and-decrypting-a-message)
56
+ - [Receiving and Decrypting a Post-Quantum Message](#receiving-and-decrypting-a-post-quantum-message)
56
57
  - [Thread Message Integrity](#thread-message-integrity)
57
58
  - [Platform Availability](#platform-availability)
58
59
  - [Desktop App](#desktop-app)
@@ -82,19 +83,23 @@ Also available on [Google Chrome Web Store](https://chromewebstore.google.com/de
82
83
  - [Decrypting Text on Any Webpage](#decrypting-text-on-any-webpage)
83
84
  - [Automatic Scanning](#automatic-scanning)
84
85
  - [Technical Specifications](#technical-specifications)
85
- - [Cryptography Stack](#cryptography-stack)
86
+ - [Post-Quantum Cryptography Stack](#post-quantum-cryptography-stack)
87
+ - [Hybrid Key Derivation](#hybrid-key-derivation)
88
+ - [Envelope Format v3 (ML-KEM Only)](#envelope-format-v3-ml-kem-only)
86
89
  - [Platform \& Infrastructure](#platform--infrastructure)
87
90
  - [Messaging Capabilities](#messaging-capabilities)
88
91
  - [Security](#security)
89
92
  - [What Majik Message Protects](#what-majik-message-protects)
90
93
  - [What Users Must Protect](#what-users-must-protect)
91
94
  - [What Majik Message Does Not Protect](#what-majik-message-does-not-protect)
95
+ - [Post-Quantum Security Guarantees](#post-quantum-security-guarantees)
92
96
  - [Roadmap](#roadmap)
93
97
  - [Use Cases](#use-cases)
94
98
  - [Privacy-Conscious Individuals](#privacy-conscious-individuals)
99
+ - [Future-Proof Security for High-Value Communications](#future-proof-security-for-high-value-communications)
95
100
  - [Journalists](#journalists)
96
101
  - [Professionals Handling Sensitive Data](#professionals-handling-sensitive-data)
97
- - [Security Researchers and Developers](#security-researchers-and-developers)
102
+ - [Security Researchers and Cryptography Professionals](#security-researchers-and-cryptography-professionals)
98
103
  - [Anyone Seeking Digital Autonomy](#anyone-seeking-digital-autonomy)
99
104
  - [Pricing](#pricing)
100
105
  - [Part of the Majikah Ecosystem](#part-of-the-majikah-ecosystem)
@@ -111,47 +116,54 @@ Also available on [Google Chrome Web Store](https://chromewebstore.google.com/de
111
116
 
112
117
  ## Overview
113
118
 
114
- Majik Message replaces traditional username and password accounts with **cryptographic identity**. Messages are encrypted end-to-end using Ed25519 and X25519 elliptic curve cryptography, ensuring only recipients with the correct private keys can decrypt them.
119
+ Majik Message replaces traditional username and password accounts with **cryptographic identity**. Messages are encrypted end-to-end using **ML-KEM-768 (FIPS-203)** post-quantum key encapsulation combined with X25519 for identity and AES-256-GCM for content encryption, ensuring your messages remain secure even against future quantum computers.
115
120
 
116
121
  Whether online or offline, you maintain full control over your encrypted communications—without relying on centralized infrastructure, personal information, or trusted intermediaries.
117
122
 
118
123
  ### What Makes Majik Message Different
119
124
 
120
- - **True End-to-End Encryption**: Military-grade encryption using Ed25519 and X25519
121
- - **Seed Phrase Identity**: No email or phone number required—your 12-word seed phrase is your account
122
- - **Works Offline**: Encrypt and decrypt messages without internet connection
125
+ - **Post-Quantum Encryption**: NIST-standardized ML-KEM-768 (FIPS-203) + X25519 + AES-256-GCM
126
+ - **Seed Phrase Identity**: No email or phone number required—your 12-word seed phrase generates both X25519 and ML-KEM-768 keypairs
127
+ - **Works Offline**: Encrypt and decrypt quantum-safe messages without internet connection
128
+ - **Argon2id KDF**: Modern memory-hard key derivation (64 MB, 3 iterations) resistant to GPU/ASIC attacks
123
129
  - **No Permanent Storage**: Messages automatically expire and are never permanently stored on servers
124
130
  - **Multi-Platform**: Desktop app, web app, and Chrome extension
125
131
 
126
132
 
127
133
  ## Key Features
128
134
 
129
- ### End-to-End Encryption
135
+ ### Post-Quantum End-to-End Encryption
130
136
 
131
- Majik Message uses proven elliptic curve cryptography:
137
+ Majik Message uses NIST-standardized post-quantum cryptography combined with proven elliptic curve algorithms:
132
138
 
133
- - **Ed25519**: Generates and manages your cryptographic identity
134
- - **X25519 (Curve25519)**: Handles secure key exchange and message encryption
135
- - **AES-256-GCM**: Encrypts message content with authenticated encryption
139
+ - **ML-KEM-768 (FIPS-203)**: Post-quantum key encapsulation mechanism based on lattice cryptography—secure against quantum computer attacks
140
+ - **X25519 (Curve25519)**: Generates your unique fingerprint and provides backward compatibility
141
+ - **AES-256-GCM**: Encrypts message content with authenticated encryption and tamper detection
142
+ - **Argon2id**: Modern memory-hard key derivation (64 MB memory, 4 threads, 3 iterations) resistant to GPU/ASIC cracking
136
143
 
137
- Every message is encrypted on your device before transmission and can only be decrypted by the intended recipient. Not even Majik Message servers can access your message content.
144
+ Every message is encrypted on your device with post-quantum algorithms before transmission and can only be decrypted by the intended recipient. Not even Majik Message servers can access your message content—and neither can a quantum computer.
138
145
 
139
- ### Seed Phrase–Based Identity
146
+ **What this means for you:** The encryption protecting your messages today will remain secure even when quantum computers become powerful enough to break traditional encryption methods like RSA and standard elliptic curves.
140
147
 
141
- Your account is a 12-word BIP39 mnemonic seed phrase—the same standard used by cryptocurrency wallets:
148
+ ### Seed Phrase–Based Hybrid Identity
142
149
 
143
- - Each seed phrase deterministically generates an Ed25519 keypair
144
- - Your public key serves as your account identity and fingerprint
145
- - Your private key never leaves your device and is never transmitted
150
+ Your account is a 12-word BIP39 mnemonic seed phrase—the same standard used by cryptocurrency wallets. From this single phrase, two keypairs are derived:
151
+
152
+ - **X25519 keypair** (from seed[0..32]): Provides your unique fingerprint and account ID for identity verification
153
+ - **ML-KEM-768 keypair** (from full seed[0..64]): Handles post-quantum message encryption (1184-byte public key, 2400-byte secret key)
154
+ - Both keypairs are deterministically generated—same seed phrase always produces the same keys
155
+ - Your private keys never leave your device and are never transmitted
146
156
  - No email, phone number, or personal information required
147
157
 
148
158
  As long as you have your 12 words, you can recover full access to your identity and decrypt your messages—anywhere, anytime.
149
159
 
160
+ **Automatic Upgrade:** Old accounts are automatically upgraded to post-quantum security when you import your backup. The mnemonic deterministically regenerates both X25519 and ML-KEM-768 keys, and Argon2id re-encrypts them with modern KDF.
161
+
150
162
  ### Offline Operation
151
163
 
152
164
  Majik Message doesn't require constant connectivity:
153
165
 
154
- - **Encrypt messages offline**: Generate encrypted messages without internet access
166
+ - **Encrypt messages offline**: Generate quantum-safe encrypted messages without internet access
155
167
  - **Decrypt messages offline**: Read previously received messages anytime
156
168
  - **Verify identities independently**: Confirm contact fingerprints using cryptographic verification
157
169
 
@@ -159,9 +171,9 @@ This makes Majik Message ideal for high-security environments, air-gapped system
159
171
 
160
172
  ### Realtime Messaging (Free for Everyone)
161
173
 
162
- When online, Majik Message provides instant encrypted messaging:
174
+ When online, Majik Message provides instant post-quantum encrypted messaging:
163
175
 
164
- - WebSocket-based realtime delivery
176
+ - WebSocket-based realtime delivery with quantum-safe encryption
165
177
  - Messages stored temporarily in Redis with automatic expiration (24 hours default, expandable to 30 days)
166
178
  - Typing indicators and read receipts for active conversations
167
179
  - Messages automatically expire and are permanently deleted from servers
@@ -170,16 +182,28 @@ When online, Majik Message provides instant encrypted messaging:
170
182
 
171
183
  Secure group conversations with up to 25 participants:
172
184
 
173
- - Each message is individually encrypted for every group member
174
- - Same security guarantees as one-on-one messaging
185
+ - Each message is individually encrypted using ML-KEM-768 key encapsulation for every group member
186
+ - Same post-quantum security guarantees as one-on-one messaging
175
187
  - Typing indicators and read receipts work in group chats
176
188
 
189
+ **How group encryption works:** A single random AES-256 key encrypts the message once. This key is then individually sealed for each recipient using ML-KEM-768 encapsulation—only the holder of the matching ML-KEM secret key can decrypt their copy.
190
+
191
+ ### Emoji and GIF Support
192
+
193
+ Express yourself with rich media while maintaining post-quantum security:
194
+
195
+ - Native emoji picker for quick reactions
196
+ - GIPHY integration for searching and sending GIFs
197
+ - Encrypted transmission (GIF URLs and emoji encrypted with ML-KEM-768)
198
+ - Works in realtime chat (individual and group conversations)
199
+
177
200
  ### Persistent Message Threads
178
201
 
179
- Cryptographic hash-chain history for important conversations:
202
+ Cryptographic hash-chain history for important conversations with post-quantum encryption:
180
203
 
181
204
  - Immutable message records with cryptographic integrity
182
205
  - Each message cryptographically linked to the previous (blockchain-style)
206
+ - All thread messages use ML-KEM-768 encryption—safe from quantum computer attacks
183
207
  - Tamper-resistant conversation history
184
208
  - Messages cannot be edited or deleted individually
185
209
  - Thread validation tool to verify message integrity
@@ -191,11 +215,13 @@ Set custom expiration times for sensitive conversations. Messages automatically
191
215
 
192
216
  ### Encrypted Message Export
193
217
 
194
- Messages can be exported as encrypted Base64 strings:
218
+ Messages can be exported as quantum-safe encrypted Base64 strings:
195
219
 
196
- - Download and archive encrypted messages locally
220
+ - Download and archive quantum-safe encrypted messages locally
197
221
  - Share encrypted content through any channel (email, file storage, etc.)
198
- - Messages remain fully encrypted outside the platform
222
+ - Messages remain fully post-quantum encrypted outside the platform
223
+
224
+ Your archived messages will remain safe even when quantum computers become mainstream.
199
225
 
200
226
  ### Solo Messages for Personal Storage
201
227
 
@@ -204,7 +230,8 @@ Encrypt messages where you are the only recipient—perfect for private notes an
204
230
  - Sender-only encryption for personal storage and archival
205
231
  - Works entirely offline in local mode (Message tab)
206
232
  - Perfect for encrypted journals, notes, passwords, or sensitive information
207
- - Export as encrypted Base64 strings for backup or transfer
233
+ - Export as quantum-safe encrypted Base64 strings for backup or transfer
234
+ - Uses the same ML-KEM-768 post-quantum encryption as group messages
208
235
 
209
236
  ### Multi-Account Support
210
237
 
@@ -224,66 +251,72 @@ Manage multiple cryptographic identities for different contexts:
224
251
 
225
252
  Available on the Google Chrome Web Store:
226
253
 
227
- - Browser-based encryption and decryption
254
+ - Browser-based post-quantum encryption and decryption
228
255
  - DOM scanning: Automatically detect encrypted messages on any webpage and decrypt them inline
229
- - Offline-only operation: Designed for local encryption/decryption workflows
256
+ - Offline-only operation: Designed for local encryption/decryption workflows with ML-KEM-768 security
230
257
 
231
258
  ---
232
259
 
233
260
  ## How It Works
234
261
 
235
- ### Account Creation
262
+ ### Account Creation (Hybrid Keypair Derivation)
236
263
 
237
264
  When you create a Majik Message account:
238
265
 
239
- 1. A 12-word BIP39 mnemonic seed phrase is generated using cryptographically secure random number generation
240
- 2. The seed phrase deterministically generates an Ed25519 keypair
241
- 3. The Ed25519 keys are converted to X25519 (Curve25519) keys for encryption
242
- 4. Your public key is hashed (SHA-256) to create your account fingerprint
243
- 5. Your private key is encrypted with a passphrase (PBKDF2-SHA256, 250k iterations) and stored locally in IndexedDB
266
+ 1. A 12-word BIP39 mnemonic seed phrase is generated using cryptographically secure random number generation (CSPRNG)
267
+ 2. The mnemonic is converted to a 64-byte seed via BIP39 PBKDF2-SHA512
268
+ 3. Two keypairs are deterministically derived from this seed:
269
+ - **X25519 keypair**: seed[0..32] Ed25519 X25519 via ed2curve (used for fingerprint & identity)
270
+ - **ML-KEM-768 keypair**: seed[0..64] ml_kem768.keygen() (used for post-quantum message encryption)
271
+ 4. Your X25519 public key is hashed (SHA-256) to create your account fingerprint
272
+ 5. Both private keys are encrypted with your passphrase using Argon2id (64 MB memory, 4 threads, 3 iterations) and stored locally in IndexedDB
244
273
 
245
- **Critical security note:** Your seed phrase and private key never leave your device. The passphrase you set protects your encrypted private key in local storage.
274
+ **Critical security note:** Your seed phrase and private keys never leave your device. The passphrase you set protects your Argon2id-encrypted private keys in local storage. Old accounts are automatically upgraded to Argon2id + ML-KEM when you import your backup—the mnemonic deterministically regenerates all keys.
246
275
 
247
- ### Sending an Encrypted Message
276
+ ### Sending a Post-Quantum Encrypted Message
248
277
 
249
278
  #### For Solo Messages (sender-only):
250
279
 
251
- 1. An ephemeral X25519 keypair is generated for this message only
252
- 2. A shared secret is computed using your ephemeral private key and your own public key (ECDH)
253
- 3. The shared secret is hashed (SHA-256) to derive a 256-bit AES key
254
- 4. Your message is encrypted with AES-256-GCM using the derived key and a random 12-byte IV
255
- 5. The encrypted message, IV, and ephemeral public key are packaged and stored locally
280
+ 1. ML-KEM-768 encapsulation is performed on your own ML-KEM public key
281
+ 2. This generates a 32-byte shared secret + 1088-byte ciphertext
282
+ 3. The 32-byte shared secret is used directly as the AES-256-GCM key
283
+ 4. Your message is encrypted with AES-256-GCM using the shared secret and a random 12-byte IV
284
+ 5. The encrypted message, IV, and ML-KEM ciphertext are packaged into a v3 envelope and stored locally
285
+
286
+ **Quantum-safe:** Even with a quantum computer, an attacker cannot decrypt this message without your ML-KEM secret key.
256
287
 
257
288
  #### For Group Messages (2+ recipients):
258
289
 
259
- 1. A random 256-bit AES key is generated for the message
260
- 2. The message is encrypted once with AES-256-GCM
261
- 3. An ephemeral X25519 keypair is generated
262
- 4. The AES key is individually encrypted for each recipient using X25519 shared secrets
290
+ 1. A random 32-byte AES key is generated for the message
291
+ 2. The message is encrypted once with AES-256-GCM using this key
292
+ 3. For each recipient: ML-KEM-768 encapsulation generates a 32-byte shared secret
293
+ 4. The group AES key is XORed with the shared secret (one-time pad): `encryptedAesKey = aesKey XOR mlKemSharedSecret`
294
+ 5. Each recipient gets their own 1088-byte ML-KEM ciphertext and encryptedAesKey in the envelope
263
295
 
264
- This ensures only authorized recipients can decrypt the message, and the ephemeral key prevents long-term compromise.
296
+ This ensures only authorized recipients can decrypt the messageand the ML-KEM encapsulation prevents quantum computer attacks.
265
297
 
266
- ### Receiving and Decrypting a Message
298
+ ### Receiving and Decrypting a Post-Quantum Message
267
299
 
268
- 1. Your device retrieves the encrypted payload from the server or extracts it from the DOM (browser extension)
300
+ 1. Your device retrieves the v3 encrypted envelope from the server or extracts it from the DOM (browser extension)
269
301
  2. The message fingerprint identifies which of your accounts should decrypt it
270
- 3. Your private key is unlocked by decrypting it with your passphrase
271
- 4. A shared secret is computed using your private key and the sender's ephemeral public key
272
- 5. The AES key is derived from the shared secret (SHA-256)
273
- 6. The message is decrypted using AES-256-GCM with the derived key and the provided IV
302
+ 3. Your private keys are unlocked by decrypting them with your passphrase via Argon2id
303
+ 4. For solo messages: Your ML-KEM-768 secret key decapsulates the 1088-byte ciphertext, recovering the 32-byte shared secret
304
+ 5. For group messages: Your ML-KEM secret key decapsulates your ciphertext, then the shared secret is XORed with your encryptedAesKey to recover the group AES key
305
+ 6. The message is decrypted using AES-256-GCM with the recovered key and the provided IV
274
306
 
275
- If decryption fails (due to tampering or incorrect keys), an authentication error is thrown and the message is rejected.
307
+ **Quantum-safe decryption:** ML-KEM decapsulation never throws on the wrong key—it returns garbage, which causes AES-GCM authentication to fail. If decryption fails (due to tampering, incorrect keys, or quantum attack attempts), an authentication error is thrown and the message is rejected.
276
308
 
277
309
  ### Thread Message Integrity
278
310
 
279
- Threads use blockchain-style message chaining:
311
+ Threads use blockchain-style message chaining with post-quantum encryption:
280
312
 
281
- 1. Each message is encrypted using the same end-to-end encryption as regular messages
282
- 2. A cryptographic hash is computed from the message content
313
+ 1. Each message is encrypted with ML-KEM-768 v3 envelope format (post-quantum secure)
314
+ 2. A cryptographic hash (SHA-256) is computed from the message content
283
315
  3. This hash is linked to the hash of the previous message in the thread
284
316
  4. The chain of hashes creates an immutable, verifiable history
285
317
  5. Any tampering breaks the hash chain and is immediately detectable
286
318
  6. Downloaded thread logs can be independently verified at any time
319
+ 7. The underlying encryption uses ML-KEM-768, so archived threads remain secure against quantum computers
287
320
 
288
321
  ---
289
322
 
@@ -325,6 +358,7 @@ Choose your platform:
325
358
  4. Enter a strong password, then click **Apply** to create the account
326
359
  5. Upon creation, a JSON backup file will be downloaded automatically
327
360
  - **Important:** Keep this file secure and private. Anyone with access to this backup can open your account and decrypt your messages.
361
+ - Your backup is encrypted with Argon2id and can fully restore both X25519 and ML-KEM-768 keypairs
328
362
 
329
363
  ### 3. Backup Your Account
330
364
 
@@ -357,10 +391,12 @@ Or share your own invite key:
357
391
  3. Click the **Share** icon
358
392
  4. Copy and share your invite key
359
393
 
394
+ **Note:** Contacts registered after the ML-KEM upgrade will automatically have both X25519 and ML-KEM-768 public keys in their contact cards.
395
+
360
396
  ### 6. Start Messaging
361
397
 
362
- - **For realtime chat**: Use the 'Chats' tab (requires at least 2 participants including yourself)
363
- - **For local encryption**: Use the 'Message' tab to encrypt messages offline and share through any channel
398
+ - **For realtime chat**: Use the 'Chats' tab (requires at least 2 participants including yourself)—all messages use ML-KEM-768 encryption
399
+ - **For local encryption**: Use the 'Message' tab to encrypt quantum-safe messages offline and share through any channel
364
400
  - **Pro tip**: You can encrypt solo messages (only yourself as recipient) for personal storage like journals or notes—available only in local mode
365
401
 
366
402
  ---
@@ -376,6 +412,7 @@ Or share your own invite key:
376
412
  3. Enter a display name and password
377
413
  4. Click **Apply** to create the account
378
414
  5. Save the downloaded JSON backup file securely
415
+ 6. Both X25519 and ML-KEM-768 keypairs are automatically derived from your seed
379
416
 
380
417
  #### Encrypting Messages
381
418
 
@@ -384,11 +421,12 @@ Or share your own invite key:
384
421
  2. Choose recipients (yourself only, or add contacts)
385
422
  3. Enter your text
386
423
  4. Choose output: Copy to clipboard, download as .txt, or download as .json
424
+ 5. All messages use ML-KEM-768 post-quantum encryption
387
425
 
388
426
  **In Realtime Chat:**
389
427
  1. Select a conversation or create a new one
390
- 2. Type your message
391
- 3. Click send - the message is automatically encrypted before transmission
428
+ 2. Type your message (emoji and GIF support available)
429
+ 3. Click send - the message is automatically encrypted with ML-KEM-768 before transmission
392
430
 
393
431
  #### Decrypting Messages
394
432
 
@@ -404,9 +442,9 @@ Or share your own invite key:
404
442
 
405
443
  - **Switch accounts**: Click on any account in the Accounts tab
406
444
  - **Register online**: Hover over account → Register Online
407
- - **Share invite key**: Hover over account → Share icon
445
+ - **Share invite key**: Hover over account → Share icon (includes both X25519 and ML-KEM-768 public keys)
408
446
  - **Export backup**: Hover over account → Export
409
- - **Import account**: Accounts tab → Import Account button
447
+ - **Import account**: Accounts tab → Import Account button (automatically upgrades old accounts to Argon2id + ML-KEM-768)
410
448
 
411
449
  #### Threads (Persistent Messaging)
412
450
 
@@ -426,7 +464,7 @@ Or share your own invite key:
426
464
  2. Click the **plus (+) icon** in the Thread Viewer
427
465
  3. Enter an optional subject and your message content
428
466
  4. Click **Send** to add to the thread
429
- - Messages are encrypted and permanently stored
467
+ - Messages are encrypted with ML-KEM-768 and permanently stored
430
468
  - Messages cannot be edited or deleted after sending
431
469
 
432
470
  ##### Managing Threads
@@ -445,7 +483,7 @@ Or share your own invite key:
445
483
  - Any participant can request thread deletion
446
484
  - Requires approval from all participants
447
485
  - Owner can delete immediately by closing with auto-delete enabled
448
- - All participants receive encrypted backup before deletion
486
+ - All participants receive quantum-safe encrypted backup before deletion
449
487
 
450
488
  **Verify Thread Integrity:**
451
489
  - Visit [https://message.majikah.solutions/threads/validate](https://message.majikah.solutions/threads/validate)
@@ -465,7 +503,7 @@ Or share your own invite key:
465
503
  3. Select **Majik Message → Encrypt**
466
504
  4. Choose to encrypt for yourself or a specific contact
467
505
 
468
- The selected text will be replaced with an encrypted string.
506
+ The selected text will be replaced with a quantum-safe encrypted string.
469
507
 
470
508
  #### Decrypting Text on Any Webpage
471
509
 
@@ -477,7 +515,7 @@ The selected text will be replaced with an encrypted string.
477
515
  1. Right-click anywhere on the page
478
516
  2. Select **Majik Message → Decrypt Page**
479
517
 
480
- All valid encrypted strings on the page will be decrypted.
518
+ All valid ML-KEM-768 encrypted strings on the page will be decrypted.
481
519
 
482
520
  #### Automatic Scanning
483
521
 
@@ -488,53 +526,81 @@ Enable automatic detection and decryption:
488
526
  3. Enable **Scan**
489
527
  4. Enter your account password when prompted
490
528
 
491
- Once enabled, any page you load will be automatically scanned for encrypted content.
529
+ Once enabled, any page you load will be automatically scanned for quantum-safe encrypted content.
492
530
 
493
531
 
494
532
  ---
495
533
 
496
534
  ## Technical Specifications
497
535
 
498
- ### Cryptography Stack
536
+ ### Post-Quantum Cryptography Stack
499
537
 
500
- | Component | Implementation |
501
- | --------------------------- | ------------------------------------------- |
502
- | Identity Generation | Ed25519 (EdDSA on Curve25519) |
503
- | Key Exchange | X25519 (ECDH on Curve25519) |
504
- | Symmetric Encryption | AES-256-GCM (authenticated encryption) |
505
- | Hash Function | SHA-256 |
506
- | Key Derivation (Passphrase) | PBKDF2-SHA256 (250,000 iterations) |
507
- | Key Derivation (Mnemonic) | PBKDF2-SHA256 (200,000 iterations) |
508
- | Mnemonic Standard | BIP39 (12-word seed phrases) |
509
- | Random Number Generation | Browser crypto.getRandomValues (CSPRNG) |
510
- | Fingerprint | SHA-256 hash of public key (Base64-encoded) |
538
+ | Component | Implementation |
539
+ | -------------------------------- | --------------------------------------------------- |
540
+ | Post-Quantum Key Encapsulation | ML-KEM-768 (FIPS-203, NIST standardized) |
541
+ | Identity Fingerprint | X25519 (Curve25519) public key |
542
+ | Symmetric Encryption | AES-256-GCM (authenticated encryption) |
543
+ | Hash Function | SHA-256 |
544
+ | Key Derivation (Passphrase) | Argon2id (64 MB memory, 4 threads, 3 iterations) |
545
+ | Key Derivation (Mnemonic) | Argon2id (32 MB memory, 4 threads, 3 iterations) |
546
+ | Mnemonic Standard | BIP39 (12-word seed phrases) |
547
+ | Random Number Generation | Browser crypto.getRandomValues (CSPRNG) |
548
+ | Fingerprint | SHA-256 hash of X25519 public key (Base64-encoded) |
549
+ | ML-KEM Key Sizes | Public: 1184 bytes, Secret: 2400 bytes, Ciphertext: 1088 bytes |
511
550
 
512
- All cryptographic operations use the **@stablelib** library suite for consistent, auditable implementations across platforms.
551
+ **Post-quantum security:** ML-KEM-768 (Module-Lattice-Based Key Encapsulation Mechanism) is a NIST-standardized algorithm (FIPS-203) based on lattice cryptography. It provides security against both classical and quantum computer attacks. All cryptographic operations use the **@stablelib** library suite and **@noble/post-quantum** for consistent, auditable implementations across platforms.
552
+
553
+ ### Hybrid Key Derivation
554
+
555
+ | Seed Slice | Derivation | Purpose |
556
+ | ------------ | ------------------------------- | ------------------------------------ |
557
+ | seed[0..32] | Ed25519 → X25519 via ed2curve | Account fingerprint & identity |
558
+ | seed[0..64] | ML-KEM-768 keygen | Post-quantum message encryption |
559
+
560
+ **How it works:** A 12-word BIP39 mnemonic generates a 64-byte seed. The first 32 bytes derive an Ed25519 keypair (converted to X25519 for encryption), which provides your fingerprint. The full 64 bytes derive an ML-KEM-768 keypair for post-quantum message encryption. Both keypairs are deterministic—same mnemonic always produces the same keys.
561
+
562
+ ### Envelope Format v3 (ML-KEM Only)
563
+
564
+ | Format | Structure |
565
+ | ---------------- | ------------------------------------------------------------------------ |
566
+ | Binary envelope | [1-byte version=3][32-byte fingerprint][JSON payload] |
567
+ | Solo payload | { iv, ciphertext, mlKemCipherText } |
568
+ | Group payload | { iv, ciphertext, keys: [{ fingerprint, mlKemCipherText, encryptedAesKey }] } |
569
+ | Scanner string | ~*$MJKMSG:<base64 of binary envelope> |
570
+
571
+ **v3 envelope (current):** Uses ML-KEM-768 key encapsulation exclusively. Legacy v1/v2 envelopes (X25519 ephemeral key exchange) have been fully deprecated. Solo messages use the ML-KEM shared secret directly as the AES key. Group messages use a random AES key sealed per-recipient via ML-KEM encapsulation (aesKey XOR mlKemSharedSecret one-time-pad construction).
513
572
 
514
573
  ### Platform & Infrastructure
515
574
 
516
- | Component | Technology |
517
- | ------------------ | -------------------------------------------- |
518
- | Realtime Messaging | WebSocket |
519
- | Message Storage | Redis with TTL (24h default, max 30 days) |
520
- | Data Persistence | No permanent server-side storage |
521
- | Local Storage | IndexedDB (encrypted private keys, contacts) |
522
- | Desktop App | Microsoft Store, GitHub Releases |
523
- | Browser Extension | Google Chrome (Chrome Web Store) |
575
+ | Component | Technology |
576
+ | ------------------ | --------------------------------------------------- |
577
+ | Realtime Messaging | WebSocket (quantum-safe encrypted) |
578
+ | Message Storage | Redis with TTL (24h default, max 30 days) |
579
+ | Thread Storage | Server-side (ML-KEM encrypted, permanent until deletion) |
580
+ | Data Persistence | No permanent server-side storage for realtime messages |
581
+ | Local Storage | IndexedDB (Argon2id-encrypted private keys, contacts) |
582
+ | Desktop App | Microsoft Store, GitHub Releases |
583
+ | Browser Extension | Google Chrome (Chrome Web Store) |
524
584
 
525
- **Important:** Messages are automatically deleted from Redis after expiration. Majik Message servers never retain message content permanently and cannot decrypt messages even during temporary storage.
585
+ **Important:** Realtime messages are automatically deleted from Redis after expiration. Threads are stored server-side (ML-KEM encrypted) until collaborative deletion is approved. Majik Message servers cannot decrypt message content in either case—and neither can a quantum computer.
526
586
 
527
587
  ### Messaging Capabilities
528
588
 
529
- | Feature | Status |
530
- | ------------------ | ------------------------- |
531
- | Text Messages | ✓ Supported |
532
- | Persistent Threads | ✓ Blockchain-style-hashing |
533
- | Group Chats | ✓ Up to 25 participants |
534
- | Typing Indicators | ✓ Supported |
535
- | Read Receipts | ✓ Supported |
536
- | Message Expiration | ✓ Custom timers available |
537
- | File/Image Sharing | Coming soon |
589
+ | Feature | Status |
590
+ | --------------------------------- | ------------------------------ |
591
+ | Text Messages | ✓ Supported (post-quantum) |
592
+ | Group Chats | ✓ Up to 25 participants (post-quantum) |
593
+ | Threads (Immutable Email) | ✓ Supported (post-quantum) |
594
+ | Thread Collaborative Deletion | ✓ Supported |
595
+ | Thread Hash Chain Verification | ✓ Supported |
596
+ | Emoji Support | ✓ Native emoji picker |
597
+ | GIF Support | GIPHY integration |
598
+ | Typing Indicators | ✓ Supported |
599
+ | Read Receipts | ✓ Supported |
600
+ | Message Expiration | ✓ Custom timers available |
601
+ | File/Image Sharing | ⧗ Coming soon |
602
+ | Voice Messages | ⧗ Coming soon |
603
+ | Video Calling | ⧗ Planned |
538
604
 
539
605
  ---
540
606
 
@@ -542,17 +608,18 @@ All cryptographic operations use the **@stablelib** library suite for consistent
542
608
 
543
609
  ### What Majik Message Protects
544
610
 
545
- - **Message content**: End-to-end encrypted with AES-256-GCM
611
+ - **Message content**: Post-quantum encrypted with ML-KEM-768 + AES-256-GCM—safe from quantum computers
546
612
  - **Identity privacy**: No phone numbers or email addresses required
547
- - **Private keys**: Never transmitted; encrypted at rest with PBKDF2-derived passphrase
548
- - **Forward secrecy**: Ephemeral keys ensure past messages remain secure even if current keys are compromised
549
- - **Message integrity**: Thread messages use blockchain-style chaining to detect tampering
613
+ - **Private keys**: Never transmitted; encrypted at rest with Argon2id (64 MB memory-hard, GPU-resistant)
614
+ - **Future-proof security**: ML-KEM-768 (FIPS-203) ensures messages remain secure even when quantum computers become powerful
615
+ - **Forward secrecy**: Each message uses fresh ML-KEM encapsulation—past messages remain secure even if current keys are compromised
616
+ - **Message integrity**: Thread messages use SHA-256 hash chaining to detect tampering
550
617
  - **Audit trails**: Downloadable, verifiable thread histories for compliance and records
551
618
 
552
619
  ### What Users Must Protect
553
620
 
554
621
  - **Your 12-word seed phrase**: This is the ONLY way to recover your account. If lost, your account and messages are permanently inaccessible. Store it securely offline.
555
- - **Your passphrase**: Protects your locally stored private key. Choose a strong, unique passphrase.
622
+ - **Your passphrase**: Protects your Argon2id-encrypted private keys in local storage. Choose a strong, unique passphrase.
556
623
  - **Device security**: If your device is compromised while your account is unlocked, an attacker could access your private keys.
557
624
 
558
625
  ### What Majik Message Does Not Protect
@@ -561,15 +628,23 @@ All cryptographic operations use the **@stablelib** library suite for consistent
561
628
  - **IP addresses**: Your IP address is visible to Majik Message servers when you connect for realtime messaging
562
629
  - **Device compromise**: If malware or an attacker gains access to your unlocked device, they may access decrypted messages or private keys
563
630
 
631
+ ### Post-Quantum Security Guarantees
632
+
633
+ - **NIST-standardized**: ML-KEM-768 (FIPS-203) is a U.S. government standard for post-quantum key encapsulation
634
+ - **Lattice-based cryptography**: Based on mathematical problems (Module Learning With Errors) that are believed to be hard for both classical and quantum computers
635
+ - **Conservative security level**: ML-KEM-768 provides security equivalent to AES-192—strong enough to resist even large-scale quantum computers
636
+ - **Future-proof**: Your messages encrypted today will remain secure even when quantum computers become mainstream
637
+
564
638
  ---
565
639
 
566
640
  ## Roadmap
567
641
 
568
642
  Majik Message is under active development. Planned features include:
569
643
 
570
- - **File and image sharing** (Coming soon): Send encrypted files and images directly through Majik Message
571
- - **Voice messages** (Coming soon): Encrypted audio recording and playback
572
- - **Mobile apps** (Planned): Native iOS and Android applications
644
+ - **File and image sharing** (Coming soon): Send quantum-safe encrypted files and images directly through Majik Message
645
+ - **Voice messages** (Coming soon): Post-quantum encrypted audio recording and playback
646
+ - **Mobile apps** (Planned): Native iOS and Android applications with ML-KEM-768 support
647
+ - **Web app** (Coming soon): Full-featured browser-based application with post-quantum security
573
648
  - **Paid tiers** (Coming soon): Subscription and pay-as-you-go options with increased account limits and extended message retention
574
649
 
575
650
  ---
@@ -577,25 +652,28 @@ Majik Message is under active development. Planned features include:
577
652
  ## Use Cases
578
653
 
579
654
  ### Privacy-Conscious Individuals
580
- If you want secure messaging without linking your phone number or email address, Majik Message provides true anonymity.
655
+ If you want quantum-safe secure messaging without linking your phone number or email address, Majik Message provides true anonymity. Your messages will remain private even in a post-quantum world.
656
+
657
+ ### Future-Proof Security for High-Value Communications
658
+ Governments, militaries, and intelligence agencies are already preparing for quantum computers. If your communications need to remain secure for decades (state secrets, long-term business strategies, sensitive research), Majik Message's ML-KEM-768 encryption protects against 'harvest now, decrypt later' attacks.
581
659
 
582
660
  ### Journalists
583
- Communicate with sources securely. The offline encryption capability allows you to exchange encrypted messages through air-gapped systems.
661
+ Communicate with sources securely with quantum-resistant encryption. The offline encryption capability allows you to exchange encrypted messages through air-gapped systems or untrusted networks without exposing sensitive information—and the encryption will remain strong even when quantum computers arrive.
584
662
 
585
663
  ### Professionals Handling Sensitive Data
586
- Lawyers, healthcare providers, researchers, and other professionals can communicate confidentially without relying on third-party platforms.
664
+ Lawyers, healthcare providers, researchers, and other professionals can use Majik Message to communicate confidentially with quantum-safe encryption without relying on third-party platforms. Your encrypted communications today will remain private even in 2040.
587
665
 
588
- ### Security Researchers and Developers
589
- Majik Message's cryptographic implementation is transparent and uses well-audited libraries (@stablelib).
666
+ ### Security Researchers and Cryptography Professionals
667
+ Majik Message's cryptographic implementation is transparent and uses well-audited libraries (@stablelib, @noble/post-quantum). It's suitable for technical users who want verifiable, inspectable post-quantum encryption based on NIST standards.
590
668
 
591
669
  ### Anyone Seeking Digital Autonomy
592
- If you believe your communications should be private by default and you want full control over your identity and data, Majik Message is designed for you.
670
+ If you believe your communications should be private by default—now and in the future—and you want full control over your identity and data, Majik Message is designed for you. Your messages are quantum-safe: even a powerful quantum computer cannot break the encryption.
593
671
 
594
672
  ---
595
673
 
596
674
  ## Pricing
597
675
 
598
- Majik Message is currently **free for all users**. Realtime messaging, encryption, and all core features are available at no cost.
676
+ Majik Message is currently **free for all users**. Realtime messaging, post-quantum encryption, and all core features are available at no cost.
599
677
 
600
678
  **Coming soon:** Paid subscription and pay-as-you-go models with expanded account limits and additional features will be available in the future.
601
679
 
@@ -605,14 +683,14 @@ Majik Message is currently **free for all users**. Realtime messaging, encryptio
605
683
 
606
684
  Majik Message is a flagship product within the Majikah system—a suite of privacy-focused, user-controlled tools designed to give individuals full ownership of their digital communications and data.
607
685
 
608
- All Majikah products share the same core principles: cryptographic identity, zero-knowledge architecture, and user sovereignty over personal information.
686
+ All Majikah products share the same core principles: cryptographic identity, zero-knowledge architecture, post-quantum security, and user sovereignty over personal information.
609
687
 
610
688
  ---
611
689
 
612
690
  ## Related Projects
613
691
 
614
692
  ### [Majik Key](https://majikah.solutions/sdk/majik-key)
615
- **Majik Key** is a seed phrase account library for creating, managing, and parsing mnemonic-based cryptographic accounts (Majik Keys). Generate deterministic key pairs from BIP39 seed phrases with simple, developer-friendly APIs.
693
+ **Majik Key** is a seed phrase account library for creating, managing, and parsing mnemonic-based cryptographic accounts (Majik Keys). Generate deterministic key pairs from BIP39 seed phrases with simple, developer-friendly APIs. Now supports ML-KEM-768 post-quantum key derivation alongside X25519.
616
694
 
617
695
  ![npm](https://img.shields.io/npm/v/@majikah/majik-key) ![npm downloads](https://img.shields.io/npm/dm/@majikah/majik-key) ![npm bundle size](https://img.shields.io/bundlephobia/min/%40majikah%2Fmajik-key) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)
618
696
 
@@ -648,4 +726,4 @@ Made with 💙 by [@thezelijah](https://github.com/jedlsf)
648
726
  ## Contact
649
727
 
650
728
  - **Business Email**: [business@thezelijah.world](mailto:business@thezelijah.world)
651
- - **Official Website**: [https://www.thezelijah.world](https://www.thezelijah.world)
729
+ - **Official Website**: [https://www.thezelijah.world](https://www.thezelijah.world)
@@ -1,3 +1,4 @@
1
+ // crypto-provider.ts from @majikah/majik-message
1
2
  import * as ed25519 from "@stablelib/ed25519";
2
3
  import ed2curve from "ed2curve";
3
4
  import { AES } from "@stablelib/aes";
@@ -1,3 +1,4 @@
1
+ // encryption-engine.ts from @majikah/majik-message
1
2
  import { mnemonicToSeedSync } from "@scure/bip39";
2
3
  import * as ed25519 from "@stablelib/ed25519";
3
4
  import ed2curve from "ed2curve";
@@ -118,7 +118,7 @@ export declare class MajikMessage {
118
118
  * Encrypt text and return a scanner string.
119
119
  * Defaults to first own account if no recipients given.
120
120
  */
121
- encryptTextForScanner(plaintext: string, recipientIds?: string[], cache?: boolean): Promise<string | null>;
121
+ encryptTextForScanner(plaintext: string, recipientPubKeys?: string[], cache?: boolean): Promise<string | null>;
122
122
  /**
123
123
  * Encrypt the current browser selection.
124
124
  */
@@ -469,17 +469,17 @@ export class MajikMessage {
469
469
  * Encrypt text and return a scanner string.
470
470
  * Defaults to first own account if no recipients given.
471
471
  */
472
- async encryptTextForScanner(plaintext, recipientIds = [], cache = true) {
472
+ async encryptTextForScanner(plaintext, recipientPubKeys = [], cache = true) {
473
473
  if (!plaintext?.trim())
474
474
  return null;
475
475
  try {
476
- if (!recipientIds.length) {
476
+ if (!recipientPubKeys.length) {
477
477
  const first = this.listOwnAccounts()[0];
478
478
  if (!first)
479
479
  throw new Error("No own account available for encryption");
480
- recipientIds = [first.id];
480
+ recipientPubKeys = [first.id];
481
481
  }
482
- return await this.composeMessage(recipientIds, plaintext, cache);
482
+ return await this.composeMessage(recipientPubKeys, plaintext, cache);
483
483
  }
484
484
  catch (err) {
485
485
  console.warn("Error: ", err);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@majikah/majik-message",
3
3
  "type": "module",
4
- "description": "Encrypt and decrypt messages on any website or platform. Secure chats with keypairs and seed-based accounts. Open source.",
5
- "version": "0.1.18",
4
+ "description": "Post-quantum end-to-end encryption with ML-KEM-768. Seed phrase–based accounts. Auto-expiring messages. Offline-ready. Exportable encrypted messages. Tamper-proof threads with blockchain-like integrity. Quantum-resistant messaging.",
5
+ "version": "0.1.19",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",