Skip to main content
Host UK

Sigil Transformation Framework (RFC-0012)

Lethean R&D Labs
RFC Framework Cryptography Go

Sigils are composable transformation units with a simple In(data)/Out(data) interface. Chain compression, encoding, hashing, and encryption together into declarative pipelines. Two methods, clear contract, infinite combinations.

Features

Composable Units

Each sigil does one thing: compress, encode, encrypt, hash

In/Out Interface

In(data) transforms forward, Out(data) reverses (if reversible)

Chaining

Transmute() chains multiple sigils into a pipeline

Reversibility Awareness

Hash sigils explicitly cannot reverse - calling Out() returns error

Installation

import "github.com/Snider/Enchantrix/pkg/sigil"

// Chain sigils together
pipeline := sigil.Transmute(
    sigil.NewCompressSigil("gzip"),
    sigil.NewChaChaPolySigil(key),
    sigil.NewBase64Sigil(),
)

encrypted := pipeline.In(plaintext)
decrypted := pipeline.Out(encrypted)

Usage

Standard Sigils

SigilIn()Out()
Base64SigilEncodeDecode
HexSigilEncodeDecode
CompressSigilCompressDecompress
ChaChaPolySigilEncryptDecrypt
HashSigilHashError (irreversible)

Design Principles

  • Simplicity: Two methods, clear contract
  • Composability: Sigils combine naturally
  • Null safety: Defined behaviour for nil/empty inputs
  • Error propagation: Clear error semantics

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 →