QSPG Polyglot Format Specification
File extension .qspg · Internal media type application/vnd.quantumsequrity.qspg (NOT submitted to IANA) · Version 2 · Last updated May 2026
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
| Property | Value |
|---|---|
| Magic bytes | 51 53 50 47 (ASCII "QSPG") |
| Magic position | Immediately after the carrier file's natural end-of-file marker |
| File extension | .qspg |
| Media type | application/vnd.quantumsequrity.qspg |
| Carrier formats supported | PDF, JPEG, PNG, ZIP |
3. File layout
4. Carrier-type identifiers
| Value | Carrier |
|---|---|
| 0x01 | |
| 0x02 | JPEG |
| 0x03 | PNG |
| 0x04 | ZIP |
5. Extraction algorithm
A QSPG-aware reader extracts the encrypted payload as follows:
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].