CBOR Format Details – Guide 2026

Student

Professional
Messages
1,478
Reaction score
1,069
Points
113
(From RFC 8949 – the official CBOR spec – and real usage in FIDO2/WebAuthn, EMV, IoT – December 2025)

What is CBOR? CBOR (Concise Binary Object Representation) is a binary data serialization format designed to be:
  • Compact (smaller than JSON)
  • Fast to encode/decode
  • Extensible
  • Self-describing (types + lengths encoded)

It’s the binary equivalent of JSON but optimized for constrained devices (IoT, smart cards, FIDO keys).

Key 2025 Stats:
  • Used in FIDO2/WebAuthn (passkeys), EMV cryptograms, CoAP, CWT (CBOR Web Token).
  • >50 % smaller than JSON on average.
  • Hardware support in most secure elements (NXP JCOP, ST33, Apple Secure Enclave).

CBOR Basic Structure (Byte-by-Byte)​

Every CBOR item starts with a header byte:
Code:
+--------+--------+-------------------------------------------------+
| Major  | Additional | Value / Length                                  |
| Type   | Info     |                                                 |
| (3 bits)| (5 bits) |                                                 |
+--------+--------+-------------------------------------------------+

Major Types (first 3 bits):
MajorTypeDescription
0Unsigned integer0 to 2^64-1
1Negative integer-1 to -2^64
2Byte stringArbitrary bytes
3Text stringUTF-8 text
4ArrayOrdered list
5MapKey-value pairs
6TagSemantic tagging (e.g., date, decimal)
7Simple / floatbool, null, float16/32/64, break

Additional Info (last 5 bits):
ValueMeaning
0–23Direct value (header byte contains data)
24Next byte = 8-bit value
25Next 2 bytes = 16-bit value
26Next 4 bytes = 32-bit value
27Next 8 bytes = 64-bit value
28–30Reserved
31Indefinite length / break

Real CBOR Examples (2025 Common Data)​

Example 1 – Simple Map (JSON equivalent: {"name": "John", "age": 30})

Hex:
Code:
A2                                      # map with 2 items
   64                                   # text string length 4
      6E616D65                          # "name"
   64                                   # text string length 4
      4A6F686E                          # "John"
   63                                   # text string length 3
      616765                            # "age"
   1E                                   # unsigned 30

Example 2 – Array of Integers [1, 2, 3]

Hex:
Code:
83                                      # array with 3 items
   01                                   # 1
   02                                   # 2
   03                                   # 3

Example 3 – FIDO2/WebAuthn AuthenticatorData (Real Passkey Example)

Typical authenticatorData (from passkey login):
Code:
49 61 6D 20 61 20 70 61 73 73 6B 65 79 ... (truncated)

  • First 32 bytes: SHA-256 of RP ID
  • Byte 33: Flags (UP, UV, AT, ED)
  • Bytes 34–37: Sign count (ATC)
  • Rest: Attested credential data or extensions

Why CBOR Is Used in Security (2025 Reasons)​

ReasonBenefit
Compact sizeSmaller payloads → faster NFC/Bluetooth
Deterministic encodingNo ambiguity → perfect for signatures
Self-describingTypes + lengths built-in
Extensible tagsSemantic meaning (dates, big nums)
BinaryNo text parsing overhead

Common CBOR Tags in 2025 (From RFC 8949)​

TagMeaningExample
0Date/time string"2025-12-17T12:00:00Z"
1Epoch timestamp1736961600
21Negative bignum-2^100
55799Self-describe CBORFor debugging

Bottom Line – December 2025​

CBOR is the binary, compact, secure replacement for JSON – mandatory in FIDO2, EMV cryptograms, IoT. Header byte = major type + additional info → everything self-contained.

For developers: Use cbor2 (Python) or tinycbor (C) libraries.

Want real examples? DM for “CBOR Nuclear Pack December 2025”:
  • Full CBOR encoding/decoding scripts
  • FIDO2 authenticatorData examples
  • EMV ARQC in CBOR

Stay technical.

Your choice.

– Based on RFC 8949 + FIDO2/WebAuthn specs (2025).
 
Top