SOURCE_URL: https://majikah.solutions/products/majik-buwiz/docs/buwiz-invoices-encryption --- title: "Encrypting Invoices with ML-KEM-768" id: "buwiz-invoices-encryption" group: "majik-buwiz" type: "products" version: "0.1.1" lastUpdated: "2026-05-13T00:00:00.000Z" difficulty: "Intermediate" time: "5 minutes" tags: [encryption, ml-kem-768, fips-203, aes-256-gcm, post-quantum, confidential, decrypt, locked, encrypted-and-signed] --- # Encrypting Invoices with ML-KEM-768 > When and how to encrypt invoices, and how recipients decrypt them ## Overview Encryption is an optional layer on top of signing that hides invoice contents so only the intended recipient can read them. This doc explains when to use encryption, how it works, and how recipients decrypt invoices. ### Signing vs. encryption Signing and encryption are two separate protections that serve different purposes. Signing proves the invoice came from you and has not been altered — it applies to every invoice automatically and makes the financial content tamper-evident. Encryption hides the invoice contents so only the intended recipient can read them — it is optional and used when confidentiality is required. An encrypted invoice is always also signed. You cannot encrypt without signing. ### When to use encryption Use encryption when the invoice contains sensitive financial information you do not want visible to anyone other than the recipient — for example, confidential project rates, undisclosed pricing agreements, or invoices for sensitive engagements. All invoices sent through the Invoice Cloud Exchange are automatically upgraded to encrypted-and-signed mode regardless of their local setting. The relay server stores only ciphertext it cannot read. ### How encryption works Majik Buwiz uses ML-KEM-768 (CRYSTALS-Kyber, NIST FIPS-203) for key encapsulation and AES-256-GCM for symmetric encryption of the invoice payload. The recipient's ML-KEM-768 public key (stored in their contact record) is used to encapsulate a one-time 32-byte shared secret. That shared secret is used directly as the AES-256-GCM key. The invoice JSON is compressed and then encrypted. The recipient's key fingerprint is stored alongside the encrypted payload so Majik Buwiz can identify which key is needed to decrypt. A minimal plaintext public summary (issuer name, recipient name, total amount, invoice type, status) remains unencrypted so the invoice can be identified without decrypting. > **NOTE:** Encryption requires the recipient to have a Majik Key with an ML-KEM-768 public key. This means the recipient must be in your Contacts directory with their full key material imported. You cannot encrypt an invoice for a recipient who is not in your directory with their key. ### How to encrypt an invoice 1. **Select the recipient from Contacts** *Recipient must have their ML-KEM public key on file* - When creating or editing an invoice, select a recipient from your Contacts directory. - Encryption is only available for contacts that have a full Majik Key on file (imported via .png contact card or invite key string). 2. **Enable encryption** *Toggle encrypted-and-signed mode* - Select Encrypted & Signed as the invoice mode from the invoice settings. - Majik Buwiz will use the recipient's ML-KEM-768 public key to encrypt the payload when you sign. - Signing and encryption happen together in a single operation — you do not need to perform them separately. ### Decrypting a received invoice When you receive an encrypted invoice, it is shown as Locked until decrypted. To decrypt, your Majik Key must be unlocked (you entered your passphrase when the app opened) and your key must be one of the listed recipients for that invoice. Select Decrypt from the invoice actions. Majik Buwiz uses your ML-KEM-768 secret key to recover the shared secret from the encapsulated ciphertext and decrypts the payload with AES-256-GCM. The decrypted invoice is held in memory for the session — closing or restarting the app clears the decrypted cache and the invoice returns to Locked state. ### Signed-only vs. encrypted-and-signed | | Signed only | Encrypted & signed | | --- | --- | --- | | Invoice content visible to | Anyone with the file | Recipient only (with their Majik Key) | | Tamper detection | Yes | Yes | | Requires recipient's public key | No | Yes — ML-KEM-768 key required | | Usable offline | Yes | Yes (encryption/decryption is local) | | Required for Invoice Cloud Exchange | No — auto-upgraded | Yes — Exchange always uses this mode | | Public summary visible without decrypting | N/A — full content is plaintext | Yes — issuer, total, status visible | | Relay server can read contents | N/A | No — server stores only ciphertext | *Caption: Choosing the right mode for your use case.* > ⚠️ **WARNING:** The decrypted invoice cache is held in memory only for the current session. When you close or restart Majik Buwiz, the decrypted cache is cleared and the invoice returns to Locked state. This is by design — private key material and decrypted content are never written to disk in plaintext.