Skip to main content

1. Overview

QSPG is a polyglot wrapper for QNSQY post-quantum encrypted payloads. A QSPG file is a byte-for-byte preserved carrier (PDF, JPEG, PNG, or ZIP) followed by an appended encrypted payload. The carrier file remains valid and openable in its native format. The encrypted payload is recoverable by scanning from the end of the file for the QSPG magic bytes.

QSPG is intended for environments where users need to transmit encrypted data alongside a benign carrier (for example, a research document delivered as a PDF with the source dataset attached). QSPG is not a steganographic primitive: the appended payload is detectable by file-size comparison or by scanning for the QSPG magic.

Registration scope. QSPG is an internal sub-format of QNSQY tooling. Only the primary .qs format is being submitted to IANA for media-type registration; the application/vnd.quantumsequrity.qspg string above is a vendor-tree identifier under our control but is not an IANA-listed media type and is not in the process of becoming one. The encrypted payload inside a QSPG carrier is itself a .qs file (QNS6 wire format, currently version 6.1) and inherits all of the security properties of that format, including the v6.1 sealed-metadata privacy refactor described in the QNSQY spec.

2. File identification

PropertyValue
Magic bytes51 53 50 47 (ASCII "QSPG")
Magic positionImmediately after the carrier file's natural end-of-file marker
File extension.qspg
Media typeapplication/vnd.quantumsequrity.qspg
Carrier formats supportedPDF, JPEG, PNG, ZIP

3. File layout

offset 0 : Carrier file (PDF / JPEG / PNG / ZIP), byte-for-byte preserved : PDF terminator: %%EOF : JPEG terminator: 0xFFD9 (EOI marker) : PNG terminator: IEND chunk : ZIP terminator: End-of-Central-Directory record appended : 4 bytes QSPG magic (51 53 50 47) : 1 byte QSPG version (0x01 v1, 0x02 v2) : 1 byte Carrier-type identifier : 1 byte Method identifier (v2 only) : 1 byte AEAD identifier (v2 only) : 4 bytes Payload length (LE u32) : N bytes AEAD-encrypted payload (a complete .qs file or raw ciphertext) : 32 bytes BLAKE3 hash of payload (trailer)

4. Carrier-type identifiers

ValueCarrier
0x01PDF
0x02JPEG
0x03PNG
0x04ZIP

5. Extraction algorithm

A QSPG-aware reader extracts the encrypted payload as follows:

1. Open the file and seek to the end. 2. Read the trailing 32 bytes (BLAKE3 hash). 3. Read the preceding 4 bytes as a little-endian payload length N. 4. Read N bytes of AEAD-encrypted payload. 5. Read the preceding header bytes (version, carrier type, method, AEAD). 6. Verify the QSPG magic bytes precede the header. 7. Verify the BLAKE3 hash matches the payload. 8. Pass the payload to the QNSQY decryption pipeline.

A reader that does not understand QSPG sees a byte-for-byte valid carrier file and ignores the trailing bytes.

6. Security considerations

QSPG is a transport convenience, not a stealth primitive. The encrypted payload is detectable by simple file-size analysis. Implementations MUST validate the QSPG magic bytes and the payload length against the actual file size before parsing further. Implementations MUST reject payload lengths that overflow or exceed the remaining file size. The payload itself is AEAD-protected; tampering is detected on decryption. The carrier portion is not authenticated by QSPG.

QSPG SHOULD NOT be used as a substitute for true steganography or for evading content scanners. Users in regulatory environments (HIPAA, 21 CFR Part 11, FDA medical device guidance) SHOULD prefer the standard QNSQY format with a CMS or S/MIME carrier (RFC 5652, RFC 8551).

7. Interoperability considerations

QSPG is defined and maintained by Quantum Sequrity. The carrier portion remains parseable by any standards-compliant PDF, JPEG, PNG, or ZIP reader. Implementations that do not recognize the QSPG trailer will treat the file as the carrier format alone. Adding or stripping the QSPG trailer does not modify the carrier content; round-trip is byte-exact.

8. Related specifications

9. Reference implementation and contact

Reference implementation: available under commercial license. Evaluation builds: quantumsequrity.com/download. Specification queries and licensing: [email protected].