Skip to main content
Host UK

SMSG Container Format (RFC-0015)

Lethean R&D Labs
RFC Container Encryption Messages

SMSG (Secure Message) is an encrypted container format using ChaCha20-Poly1305. Public manifest readable without decryption, multiple format versions for different use cases, optional chunking for large files and seeking.

Features

ChaCha20-Poly1305

Authenticated encryption - tamper-evident and secure

Public Manifest

Metadata (title, type, size) visible without decryption

Format Versions

v1 legacy, v2 binary (default), v3 streaming for large files

Chunked Mode

Large files split into chunks for random access

Installation

# Encrypt
borg smsg encrypt -i data.json -p "password" -o data.smsg

# Decrypt
borg smsg decrypt -i data.smsg -p "password" -o data.json

Usage

Binary Layout

Offset  Size    Field
------  -----   ------------------------------------
0       4       Magic: "SMSG" (ASCII)
4       2       Version: uint16 little-endian
6       3       Header Length: 3-byte big-endian
9       N       Header JSON (plaintext)
9+N     M       Encrypted Payload

More from Lethean R&D Labs

View all projects →

Fancy helping out?

Spotted a bug? Got an idea? We'd love to hear from you.

Read the contributing guide →