astrid-crypto
Cryptographic primitives for the Astrid secure agent runtime.
Overview
This crate provides the cryptographic foundation for Astrid, implementing the core philosophy: Cryptography over prompts. Authorization comes from ed25519 signatures and capability tokens, not from hoping the LLM follows instructions.
Features
- Ed25519 Key Pairs - Asymmetric signing with secure memory handling via
zeroize - Digital Signatures - Sign and verify capability tokens and audit entries
- BLAKE3 Content Hashing - Fast, secure hashing for audit chains and verification
- Serialization - Serde support with base64/hex encoding
Key Exports
KeyPair- Ed25519 signing key pair with secure memoryPublicKey- Ed25519 public key for verificationSignature- Digital signature wrapperContentHash- BLAKE3 hash for content verification
Usage
use ;
// Generate a new key pair
let keypair = generate;
// Sign a message
let message = b"important data";
let signature = keypair.sign;
// Verify the signature
assert!;
// Hash content
let hash = hash;
println!;
Dependencies
ed25519-dalek- Ed25519 signaturesblake3- Content hashingzeroize- Secure memory clearingserde- Serialization support
Security
This crate enforces #![deny(unsafe_code)] and uses zeroize to clear
sensitive key material from memory when dropped.
License
This crate is licensed under the MIT license.