{"id":28197923,"url":"https://github.com/onlyf0ur/pq-msg","last_synced_at":"2026-02-23T18:37:05.278Z","repository":{"id":290555616,"uuid":"974783392","full_name":"OnlyF0uR/pq-msg","owner":"OnlyF0uR","description":"Pure Rust abstractions for higher-level implementations of post-quantum cryptography in secure messaging protocols.","archived":false,"fork":false,"pushed_at":"2025-04-29T18:57:10.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T23:47:56.672Z","etag":null,"topics":["cryptography","encryption","key-exchange","messaging","nist-pqc","post-quantum-cryptography"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/pq-msg","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OnlyF0uR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T09:51:29.000Z","updated_at":"2025-05-30T21:14:57.000Z","dependencies_parsed_at":"2025-04-29T12:54:26.787Z","dependency_job_id":"f3ce83e8-53e5-40b2-8a47-fee70b04caba","html_url":"https://github.com/OnlyF0uR/pq-msg","commit_stats":null,"previous_names":["onlyf0ur/pq-msg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OnlyF0uR/pq-msg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnlyF0uR%2Fpq-msg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnlyF0uR%2Fpq-msg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnlyF0uR%2Fpq-msg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnlyF0uR%2Fpq-msg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OnlyF0uR","download_url":"https://codeload.github.com/OnlyF0uR/pq-msg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnlyF0uR%2Fpq-msg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29750726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cryptography","encryption","key-exchange","messaging","nist-pqc","post-quantum-cryptography"],"created_at":"2025-05-16T17:16:33.580Z","updated_at":"2026-02-23T18:37:05.259Z","avatar_url":"https://github.com/OnlyF0uR.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pq-msg\n\n[![Crates.io](https://img.shields.io/crates/v/pq-msg.svg)](https://crates.io/crates/pq-msg)\n[![Documentation](https://docs.rs/pq-msg/badge.svg)](https://docs.rs/pq-msg)\n[![License](https://img.shields.io/crates/l/pq-msg.svg)](https://github.com/OnlyF0uR/pq-msg)\n\n## 🔒 Overview\n\nA Rust crate that combines multiple post-quantum cryptographic techniques to facilitate quantum-resistant end-to-end encrypted messaging. `pq-msg` serves as an abstraction layer over various cryptographic schemes to provide a comprehensive solution for secure communication in a post-quantum world.\n\n## 🛠️ Cryptographic Foundation\n\n| Component | Implementation | Purpose |\n|-----------|---------------|---------|\n| **Key Exchange** | ML-KEM (FIPS 203) | Quantum-resistant key establishment |\n| **Symmetric Encryption** | XChaCha20Poly1305 | Fast and secure data encryption |\n| **Message Authentication** | Falcon (FN-DSA, FIPS 206) | Quantum-resistant digital signatures |\n\n## ⚙️ Usage\n\n```rust\nuse pq_msg::{\n    exchange::pair::KEMPair, messaging::MessageSession, messaging::create_nonce,\n    messaging::gen_session_id, signatures::keypair::SignerPair,\n};\n\nfn main() {\n    let alice_kem = KEMPair::create();\n    let alice_signer = SignerPair::create();\n\n    let bob_kem = KEMPair::create();\n    let bob_signer = SignerPair::create();\n\n    // Create a base nonce with a new session id, and a counter of\n    let base_nonce = create_nonce(\u0026gen_session_id(), 0);\n\n    // Lets create the message session for Alice first\n    let (mut alice_session, ciphertext) = MessageSession::new_initiator(\n        alice_kem,\n        alice_signer.clone(),\n        base_nonce,\n        \u0026bob_kem.to_bytes().unwrap().0,    // Bob's public KEM key\n        \u0026bob_signer.to_bytes().unwrap().0, // Bob's public signer key\n    )\n    .unwrap();\n\n    // Now for Bob it would look like this\n    let mut bob_session = MessageSession::new_responder(\n        bob_kem,\n        bob_signer.clone(),\n        base_nonce,\n        \u0026ciphertext,\n        \u0026alice_signer.to_bytes().unwrap().0, // Alice's public signer key\n    )\n    .unwrap();\n\n    // Now both sessions contain a shared secret they use to encrypt and decrypt messages\n    // and a nonce that is incremented with each message sent or received.\n\n    // Alice creates a mesasge and prepares to send it to Bob\n    let message = b\"Hello, Bob! This is a secret message.\";\n    let encrypted_message = alice_session.craft_message(message).unwrap();\n\n    // Bob decrypts and verifies Alice's message\n    let raw_message = bob_session.validate_message(\u0026encrypted_message).unwrap();\n\n    // Both message and raw_message are equal, let's print them out to illustrate\n    let message_str = String::from_utf8_lossy(message);\n    let raw_message_str = String::from_utf8_lossy(\u0026raw_message);\n\n    println!(\"[1] Alice's message: {}\", message_str);\n    println!(\"[2] Bob's decrypted message: {}\", raw_message_str);\n\n    // Bob crafts a reply message to Alice\n    let reply = b\"Hello, Alice! I received your message safely.\";\n    let encrypted_reply = bob_session.craft_message(reply).unwrap();\n\n    // Alice decrypts and verifies Bob's reply\n    let raw_reply = alice_session.validate_message(\u0026encrypted_reply).unwrap();\n\n    // Both reply and raw_reply are equal, let's print them again\n    let reply_str = String::from_utf8_lossy(reply);\n    let raw_reply_str = String::from_utf8_lossy(\u0026raw_reply);\n\n    println!(\"[3] Bob's reply: {}\", reply_str);\n    println!(\"[4] Alice's decrypted reply: {}\", raw_reply_str);\n}\n```\n\nRun this example with:\n```bash\ncargo run --example full_exchange\n```\n\n## ⚠️ Important Notice\n\n**This library is currently in development and should be considered experimental.**\n\nSome of the cryptographic packages used have not been independently audited, and certain components are awaiting final standardization by NIST. Please refrain from using this in production environments and consider it for educational and research purposes until further notice.\n\n## 📚 Documentation\n\nFor full documentation and examples, please visit [docs.rs/pq-msg](https://docs.rs/pq-msg).\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📝 License\n\nThis project is licensed under the [MIT](LICENSE-MIT)/[Apache-2.0](LICENSE-APACHE) dual license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyf0ur%2Fpq-msg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlyf0ur%2Fpq-msg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyf0ur%2Fpq-msg/lists"}