Saorsa Seal
Threshold sealing for group data in the Saorsa network - a comprehensive solution for secure, distributed data storage with threshold cryptography and forward error correction.
Features
- Threshold Sealing: Secure data using Shamir's Secret Sharing with configurable thresholds
- Forward Error Correction: Reed-Solomon coding for data recovery and fault tolerance
- AEAD Encryption: XChaCha20-Poly1305 authenticated encryption via saorsa-fec
- Post-Quantum Cryptography: ML-KEM-768 encryption for quantum-resistant security
- Distributed Storage: DHT abstraction for decentralized data storage
- Verifiable Shares: Feldman commitments for share verification
- Envelope Encryption: Post-quantum recipient encryption using ML-KEM-768
- Async/Await: Full async support with tokio integration
Architecture
This crate leverages the Saorsa ecosystem:
- [
saorsa-core]: Threshold cryptography and DHT abstraction - [
saorsa-fec]: Forward error correction and AEAD encryption - [
saorsa-pqc]: Post-quantum cryptography
Quick Start
Add this to your Cargo.toml:
[]
= "0.1.0"
= { = "1.0", = ["full"] }
Basic Usage
use ;
use HashMap;
use Mutex;
// Simple DHT implementation for testing
async
Configuration
Seal Policy
use ;
let policy = SealPolicy ;
Envelope Types
EnvelopeKind::None: No recipient-level encryption (shares stored in plaintext)EnvelopeKind::PostQuantum: ML-KEM-768 post-quantum encryption
Performance
The library is optimized for throughput with configurable chunking:
- Small files (< 1MB): Direct processing
- Large files: Chunked processing with parallel FEC encoding
- Symbol size: Configurable for optimal memory usage
- Streaming: Async iterators for large datasets
Benchmarks show:
- 1KB files: ~100μs sealing time
- 100MB files: ~500ms sealing time
- Memory usage: ~2x symbol_size × (data_shares + parity_shares)
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.