Cryptographic Protocol Specification

Mehr's Unique Voucher (MUV)

Ultra-compact, constant-width activation token protocol designed for offline cold nodes and central domestic verification systems.

48-Char Constant Base62
AES-256-SIV Zero Nonce
19-Byte Pure Binary Payload
O(1) Byte-Offset Slicing
Live Token Inspector & Validator
35-Byte SIV Stream Representation 48 chars / 280 bits
74 b0 8c bf c0 6b ff 64 65 8b 1d 4a 6c d1 4d e3 33 a0 93 41 07 1d d9 55 b9 db f2 94 5f 80 d3 13 b3 50 94
Contract ID
0x01 (v1)
Provider ID
42
Product ID (SKU)
1001
Product Options
0xDEADBEEF
Order ID Nonce
8841
Expiration
30 Days (Active)
01 / ARCHITECTURE

Core Design Principles

`muv` replaces bloated JSON tokens with an unpadded, immutable 48-character string, maximizing copy-paste convenience and offline security.

01

Constant 48-Char Footprint

Every token strictly encodes to 48 characters (0-9a-zA-Z). Strict UI validation ensures immediate format checking before network roundtrips.

02

Zero-Nonce AES-256-SIV

Standard AEAD (GCM) wastes 12–16 bytes on nonces. AES-SIV synthesizes the IV tag directly from the message via AES-CMAC, requiring 0 bytes of transmitted nonce.

03

Single Master Key (O(1))

A shared symmetric key allows instant decryption and integrity verification in O(1) without per-provider trial decryptions or key lookup loops.

04

19-Byte Pure Binary Payload

All operational identifiers, 4-byte custom options, and relative timestamps pack into 19 raw unparsed bytes in Network Byte Order (Big-Endian).

02 / DATA LAYOUT

Binary Payload Specification

Exactly 19 bytes (152 bits) arranged in strict big-endian network byte order.

Offset Size Field Name Type Description / Range
0 1 Byte contract_id uint8 Schema contract version (e.g., 0x01)
1 1 Byte provider_id uint8 Cold node identifier (0–255) matched against authorized product tiers
2–3 2 Bytes product_id uint16 SKU / product tier identifier (0–65,535, Big-Endian)
4–7 4 Bytes product_opts uint32 Application-defined options or bitmask flags
8–11 4 Bytes order_id uint32 Provider-specific order nonce for replay protection
12–15 4 Bytes created_ts uint32 Seconds elapsed since fixed epoch (1790022600)
16–18 3 Bytes expires_min uint24 Duration in minutes from creation (0 = permanent, up to ~31.9 yrs)
Total: 19 Bytes Payload + 16 Bytes SIV Tag = 35 Bytes → Exactly 48 Base62 Characters.
03 / TIME & CRYPTOGRAPHY

Epoch & Cryptographic Pipeline

Relative epoch offsets conserve 4 bytes per voucher while RFC 5297 provides misuse-resistant authenticated encryption.

Fixed Epoch Reference

Base timestamp: 2026-09-22 00:00:00 (UTC+3:30) = Unix timestamp 1790022600.

created_ts = unix_now - 1790022600
is_valid = unix_now <= 1790022600 + created_ts + (expires_min * 60)

AES-256-SIV Pipeline

Uses a 512-bit (64-byte) master key. AES-CMAC produces a 16-byte tag that serves as CTR mode IV.

1. Tag (16B) = AES-CMAC(K_mac, S2V(Payload))
2. CT  (19B) = AES-CTR(K_ctr, IV=Tag, Payload)
3. 35B Stream = Tag || CT
04 / VERIFIED TEST VECTOR

End-to-End Walkthrough Example

Every implementation validates against these exact bit-for-bit test vectors:

STEP 1: 64-BYTE MASTER KEY (HEX)
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
STEP 2: PACKED 19-BYTE PLAINTEXT (HEX)
01 2a 03 e9 de ad be ef 00 00 22 89 03 c3 0f c0 00 a8 c0
STEP 3: 35-BYTE CIPHERTEXT (16B SIV TAG + 19B ENCRYPTED PAYLOAD)
74 b0 8c bf c0 6b ff 64 65 8b 1d 4a 6c d1 4d e3  [-- 16B SIV Tag --]
33 a0 93 41 07 1d d9 55 b9 db f2 94 5f 80 d3 13  [-- 19B Ciphertext --]
b3 50 94
STEP 4: FINAL 48-CHARACTER BASE62 TOKEN
0vpTn7oJ1fqwsdY9sxnX9EKoE2Wf5uJDzVSxJQDDO6LIV0kA
05 / IMPLEMENTATIONS

Reference Code & Tooling

Minimal reference scripts with built-in self-testing and CLI keygen.

muv.py (Standard Library + cryptography)
# Generate a 64-byte master key
./muv.py keygen

# Run self-test against RFC 5297 vectors
./muv.py test

# Issue a voucher
./muv.py issue --provider 42 --product 1001 --opts 0xDEADBEEF --order 8841 --expires-min 43200

# Verify a voucher token
./muv.py verify 0vpTn7oJ1fqwsdY9sxnX9EKoE2Wf5uJDzVSxJQDDO6LIV0kA
muv.js (Zero npm dependencies)
# Generate a 64-byte master key
node muv.js keygen

# Run self-test
node muv.js test

# Issue a voucher
node muv.js issue 42 1001 0xdeadbeef 8841 63115200 43200

# Verify a voucher token
node muv.js verify 0vpTn7oJ1fqwsdY9sxnX9EKoE2Wf5uJDzVSxJQDDO6LIV0kA
muv.php (Zero Composer dependencies)
# Generate a 64-byte master key
php muv.php keygen

# Run self-test
php muv.php test

# Issue a voucher
php muv.php issue 42 1001 deadbeef 8841 63115200 43200

# Verify a voucher token
php muv.php verify 0vpTn7oJ1fqwsdY9sxnX9EKoE2Wf5uJDzVSxJQDDO6LIV0kA