Cryptographic Primitives

Small, auditable implementations intended for inspection rather than blind reuse. These primitives exist to demonstrate correct usage and enable review, not to replace established libraries.


Philosophy

Inspection Over Trust

Cryptographic code should be readable by those who use it. Implementations here prioritize clarity over optimization.

Minimal Surface

Each primitive does one thing. Composition is explicit. Hidden complexity creates hidden vulnerabilities.

Known Limitations

Every implementation documents what it does not protect against. Side-channel resistance, timing attacks, and implementation boundaries are stated explicitly.


Available Primitives

Symmetric Encryption

Reference implementations of authenticated encryption. Key derivation, nonce handling, and associated data patterns.

Asymmetric Operations

Key generation, signing, and verification. Emphasis on safe defaults and clear failure modes.

Hash Functions

Cryptographic hashing with documented collision resistance properties and use-case guidance.

Key Management Patterns

Storage, rotation, and destruction patterns. Emphasis on what happens when things go wrong.


When Not to Use These

These implementations exist for learning and review. Production cryptography requires production-grade tools.