{"id":31841565,"url":"https://github.com/dirvine/saorsa-mls","last_synced_at":"2025-10-12T05:21:07.277Z","repository":{"id":310077221,"uuid":"1038460524","full_name":"dirvine/saorsa-mls","owner":"dirvine","description":"Message Layer Security (MLS) protocol implementation for P2P secure group communication","archived":false,"fork":false,"pushed_at":"2025-10-04T20:27:15.000Z","size":1684,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T20:58:12.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirvine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-AGPL-3.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T08:35:19.000Z","updated_at":"2025-08-22T07:45:32.000Z","dependencies_parsed_at":"2025-08-15T16:37:58.550Z","dependency_job_id":null,"html_url":"https://github.com/dirvine/saorsa-mls","commit_stats":null,"previous_names":["dirvine/saorsa-mls"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dirvine/saorsa-mls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-mls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-mls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-mls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-mls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirvine","download_url":"https://codeload.github.com/dirvine/saorsa-mls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-mls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010341,"owners_count":26084738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-12T05:21:01.751Z","updated_at":"2025-10-12T05:21:07.270Z","avatar_url":"https://github.com/dirvine.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saorsa MLS\n\n[![Crates.io](https://img.shields.io/crates/v/saorsa-mls.svg)](https://crates.io/crates/saorsa-mls)\n[![Documentation](https://docs.rs/saorsa-mls/badge.svg)](https://docs.rs/saorsa-mls)\n[![Tests](https://github.com/dirvine/saorsa-mls/actions/workflows/test.yml/badge.svg)](https://github.com/dirvine/saorsa-mls/actions/workflows/test.yml)\n\nExperimental implementation of the Message Layer Security (MLS) Protocol ([RFC 9420](https://datatracker.ietf.org/doc/rfc9420/)) with post-quantum cryptography enhancements for P2P secure group communication.\n\n## Status and scope\n\nThis crate implements core concepts from [RFC 9420 (The Messaging Layer Security Protocol)](https://datatracker.ietf.org/doc/rfc9420/) while replacing classical cryptographic primitives with post-quantum alternatives. It provides RFC 9420-compatible protocol flow and semantics, but uses quantum-resistant algorithms (ML-KEM and ML-DSA) instead of traditional elliptic curve cryptography.\n\nDo not use this crate to protect sensitive data in production systems.\n\n## Features\n\n- **RFC 9420 Protocol Flow**: Implements MLS protocol semantics and message flow\n- **Post-Quantum Cryptography**: Uses NIST-standardized ML-KEM (Kyber) and ML-DSA (Dilithium) algorithms\n- **Group Management**: Create, join, and manage secure group communication per RFC 9420\n- **Forward Secrecy**: Cryptographic forward secrecy through epoch-based key rotation\n- **Post-Compromise Security**: Automatic recovery from member key compromise\n- **TreeKEM**: RFC 9420-compliant tree-based group key agreement with PQC\n- **Asynchronous Architecture**: Built on Tokio for high-performance async operations\n- **Memory Safe**: Written in Rust with secure zeroization of sensitive data\n\n## Architecture (high-level)\n\nThe MLS implementation provides secure group messaging with the following components:\n\n### Core Components (RFC 9420 with PQC)\n\n- **Group Management**: RFC 9420-compliant group creation and membership operations\n- **Key Derivation**: HKDF-based key schedule as specified in RFC 9420 Section 8\n- **Message Encryption**: ChaCha20-Poly1305 AEAD encryption (RFC 9420 Section 5.2)\n- **Signature Verification**: ML-DSA (Dilithium) signatures for quantum-resistant authentication\n- **Key Agreement**: ML-KEM (Kyber) for post-quantum key encapsulation\n- **TreeKEM**: RFC 9420 Section 7 tree-based group key agreement with PQC adaptations\n\n### Security Properties (RFC 9420 Section 1.1)\n\n- **Forward Secrecy**: Epoch-based key rotation ensures past messages remain secure (RFC 9420 Section 1.1.1)\n- **Post-Compromise Security**: Automatic recovery from member key compromise through TreeKEM updates\n- **Authentication**: Quantum-resistant ML-DSA signatures authenticate all group operations\n- **Integrity**: AEAD encryption provides message integrity and confidentiality\n- **Quantum Resistance**: ML-KEM and ML-DSA provide security against quantum computer attacks\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsaorsa-mls = \"0.1.0\"\n```\n\n### Basic example\n\n```rust\nuse saorsa_mls::{MlsGroup, MemberIdentity, GroupConfig};\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    // Create a new group\n    let config = GroupConfig::default();\n    let creator = MemberIdentity::generate();\n    let mut group = MlsGroup::new(config, creator).await?;\n\n    // Add members to the group\n    let member1 = MemberIdentity::generate();\n    let member2 = MemberIdentity::generate();\n\n    group.add_member(\u0026member1).await?;\n    group.add_member(\u0026member2).await?;\n\n    // Send a message to the group\n    let plaintext = b\"Hello, experimental MLS!\";\n    let encrypted = group.encrypt_message(plaintext).await?;\n\n    // Decrypt the message\n    let decrypted = group.decrypt_message(\u0026encrypted).await?;\n    assert_eq!(plaintext, \u0026decrypted[..]);\n\n    Ok(())\n}\n```\n\n### Advanced notes\n\n- The only available ciphersuite today is `CipherSuite::Ed25519ChaCha20Poly1305Blake3`.\n- Epoch changes can be triggered with `group.update_epoch().await?;`.\n- The wire format uses `bincode` serialization and is not stable across versions.\n\n## Protocol Details (RFC 9420 with PQC)\n\n### Cipher Suites\n\nPost-quantum cipher suites replacing RFC 9420 Section 16.1:\n- **MlKem768MlDsa65**: ML-KEM-768 + ML-DSA-65 + ChaCha20-Poly1305 + BLAKE3 (NIST Level 3)\n- **MlKem1024MlDsa87**: ML-KEM-1024 + ML-DSA-87 + ChaCha20-Poly1305 + BLAKE3 (NIST Level 5)\n\n### Key Schedule (RFC 9420 Section 8)\n\n- **HKDF-SHA256**: Key derivation function for epoch secrets\n- **ML-KEM**: Post-quantum key encapsulation replacing ECDH\n- **ML-DSA**: Post-quantum signatures replacing EdDSA\n- **Labels**: RFC 9420-compliant KDF labels for all derived secrets\n\n### Message Formats (RFC 9420 Section 6)\n\nAll messages follow RFC 9420 wire format with PQC adaptations:\n- **MLSMessage**: Top-level message container (Section 6)\n- **ApplicationMessage**: AEAD-encrypted group content (Section 6.3)\n- **HandshakeMessage**: Group operations (Add, Remove, Update, Commit) (Section 12)\n- **Welcome**: New member onboarding with encrypted group secrets (Section 12.4.3)\n- **KeyPackage**: Member credentials and public keys (Section 10)\n\n## Performance\n\nThe implementation is optimized for:\n- **Low Latency**: Minimal cryptographic overhead\n- **High Throughput**: Efficient batch operations\n- **Memory Efficiency**: Zero-copy operations where possible\n- **Async Operations**: Non-blocking I/O for network operations\n\n## Security considerations\n\nThis crate is not yet production-ready. Important limitations include:\n- Key agreement and TreeKEM are simplified; TreeKEM path secrets are placeholder logic.\n- Signatures and credential handling are simplified in places; some signatures are placeholders in tests/examples.\n- Nonce uniqueness previously relied on randomness; now derived from (epoch, sequence) but still lacks full MLS transcript binding.\n- Secrets are now zeroized where feasible, but not all paths are audited.\n- Serialization uses `bincode` with size limits; no versioning yet.\n\nUntil these are addressed, treat this crate as a prototype for experimentation only.\n\n## Testing\n\nRun the test suite:\n\n```bash\ncargo test\n```\n\nRun benchmarks (optional):\n\n```bash\ncargo bench\n```\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.\n\n## License\n\nThis project is dual-licensed under:\n- GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)\n- Commercial License\n\nFor AGPL-3.0 license details, see [LICENSE-AGPL-3.0](LICENSE-AGPL-3.0).\nFor commercial licensing, contact: saorsalabs@gmail.com\n\n## Security\n\nFor security issues, please contact: saorsalabs@gmail.com\n\nDo not report security vulnerabilities through public GitHub issues.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirvine%2Fsaorsa-mls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirvine%2Fsaorsa-mls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirvine%2Fsaorsa-mls/lists"}