{"id":32667062,"url":"https://github.com/miyuruamarasiri/qsafe","last_synced_at":"2026-05-09T05:04:11.104Z","repository":{"id":321375279,"uuid":"1083749624","full_name":"MiyuruAmarasiri/Qsafe","owner":"MiyuruAmarasiri","description":"This repository scaffolds an advanced MVP for a post-quantum secure communication stack. It focuses on hybrid authenticated key exchange, mutual hardware-backed attestation, and transport-agnostic encrypted messaging with deep observability and supply-chain hardening.","archived":false,"fork":false,"pushed_at":"2025-11-23T19:36:25.000Z","size":29359,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T21:13:55.039Z","etag":null,"topics":["1password","advanced-algorithms","github","github-copilot","gitkraken","gitlens","go","jetbrains","learn","notion","protocol","quantimental-analysis","quantom-cryptography","quantum-algorithms","quantum-computing","quantum-information","quantum-machine-learning","quantum-mechanics","stripe"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiyuruAmarasiri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"MiyuruAmarasiri","patreon":"MiyuruAmarasiri","ko_fi":"amarasiri"}},"created_at":"2025-10-26T16:38:56.000Z","updated_at":"2025-11-23T19:36:19.000Z","dependencies_parsed_at":"2025-10-29T10:37:15.900Z","dependency_job_id":null,"html_url":"https://github.com/MiyuruAmarasiri/Qsafe","commit_stats":null,"previous_names":["miyuruamarasiri/qsafe"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MiyuruAmarasiri/Qsafe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiyuruAmarasiri%2FQsafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiyuruAmarasiri%2FQsafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiyuruAmarasiri%2FQsafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiyuruAmarasiri%2FQsafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiyuruAmarasiri","download_url":"https://codeload.github.com/MiyuruAmarasiri/Qsafe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiyuruAmarasiri%2FQsafe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["1password","advanced-algorithms","github","github-copilot","gitkraken","gitlens","go","jetbrains","learn","notion","protocol","quantimental-analysis","quantom-cryptography","quantum-algorithms","quantum-computing","quantum-information","quantum-machine-learning","quantum-mechanics","stripe"],"created_at":"2025-11-01T02:00:48.726Z","updated_at":"2026-05-09T05:04:11.099Z","avatar_url":"https://github.com/MiyuruAmarasiri.png","language":"Go","funding_links":["https://github.com/sponsors/MiyuruAmarasiri","https://patreon.com/MiyuruAmarasiri","https://ko-fi.com/amarasiri"],"categories":[],"sub_categories":[],"readme":"# Quantum-Safe Communication Protocol\n\nThis repository scaffolds an advanced MVP for a post-quantum secure communication stack. It focuses on hybrid authenticated key exchange, mutual hardware-backed attestation, and transport-agnostic encrypted messaging with deep observability and supply-chain hardening.\n\n## Highlights\n- Dual-track handshake combining ML-KEM (Kyber) encapsulation with ML-DSA (Dilithium) signatures and controlled downgrades to classical TLS 1.3.\n- Mutual device identity enforced through TPM/HSM attestations prior to session key derivation.\n- Transport-neutral framing (gRPC/WebSocket) with AEAD-protected payloads seeded from PQ-derived keys and deterministic rotation schedules.\n- Integrated telemetry, threat modeling, fuzzing, and CI pipelines to detect downgrade attempts, side channels, and crypto drift.\n\nRefer to `docs/` for design, threat modeling, and compliance collateral, and to `infra/` and `.ci/` for environment automation.\n\n## Getting Started\n\n```bash\nmake bootstrap   # optional: toolchains + direnv\nmake tidy        # ensure go.sum is up-to-date\nmake test        # run unit test suites\nmake build       # build gateway and agent binaries into dist/\n```\n\n### Send a message locally\n\n```bash\n# ensure Docker Desktop/daemon is running\nmake compose-up   # starts the gateway on :8443\n\n# run the reference agent and send an encrypted message\ngo run ./cmd/agent -gateway http://localhost:8443 -message \"hello quantum\"\n```\n\nThe agent fetches gateway metadata, performs the PQ handshake, encrypts your payload, and prints the gateway’s decrypted response plus any rotation hint.\n\n### Manual HTTP flow (advanced)\n\n1. Discover server parameters: `curl http://localhost:8443/handshake/config`\n2. Build a `ClientInit` (Kyber768 encapsulation to `kem_public`, include your capabilities/nonce/timestamp) and POST it:  \n   `curl -X POST http://localhost:8443/handshake/init -H \"Content-Type: application/json\" -d @client_init.json`\n3. Derive session keys from the response, create a `state.Session` (RoleClient), encrypt with `Session.Encrypt`, then POST the envelope:  \n   `curl -X POST http://localhost:8443/message -H \"Content-Type: application/json\" -d '{\"session_id\":\"\u003cid\u003e\",\"envelope\":{...}}'`\n\nSee `pkg/session/state` for the exact structs used in the handshake and message envelope.\n\n### Testing tips (Windows)\n\nIf your environment blocks writes to `%APPDATA%`, point Go caches to the workspace before running tests:\n\n```powershell\n$base = Get-Location\n$env:APPDATA     = Join-Path $base '.appdata'\n$env:LOCALAPPDATA= $env:APPDATA\n$env:TEMP        = Join-Path $base '.gotmp'\n$env:TMP         = $env:TEMP\n$env:GOTMPDIR    = $env:TEMP\n$env:GOPATH      = Join-Path $base '.gopath'\n$env:GOCACHE     = Join-Path $base '.gocache'\n$env:GOMODCACHE  = Join-Path $base '.gomodcache'\ngo test ./...\n```\n\n## Deploying\n\n- Update `infra/terraform/providers.tf` (and/or add `backend` blocks) with your team's remote state location, VPC settings, and IAM wiring prior to applying infrastructure.\n- Edit `infra/helm/gateway/values.yaml` to point `image.repository` and `image.tag` at the container registry used by your release pipeline. Provide environment-specific overrides (e.g., `values-prod.yaml`) as needed.\n- CI already emits SBOMs and vulnerability scan reports; ensure the GitHub Actions runner has access to Cosign/Trivy/Syft credentials in your environment.\n\nOnce infrastructure and image references are configured, apply Terraform, publish the gateway/agent images, and install the Helm chart to bring the quantum-safe handshake service online.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyuruamarasiri%2Fqsafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyuruamarasiri%2Fqsafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyuruamarasiri%2Fqsafe/lists"}