{"id":27328733,"url":"https://github.com/10d9e/zk-pass","last_synced_at":"2025-04-12T12:17:00.272Z","repository":{"id":205018018,"uuid":"711162160","full_name":"10d9e/zk-pass","owner":"10d9e","description":"A password authentication service, based on the chaum-pedersen zero-knowledge interactive protocol","archived":false,"fork":false,"pushed_at":"2023-11-14T16:19:58.000Z","size":1756,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T12:16:44.826Z","etag":null,"topics":["chaum-pedersen","cryptography","rust","zero-knowledge"],"latest_commit_sha":null,"homepage":"https://10d9e.github.io/zk-pass/zk_pass/","language":"Rust","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/10d9e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-28T11:59:32.000Z","updated_at":"2023-11-28T20:27:29.000Z","dependencies_parsed_at":"2023-11-27T19:38:48.901Z","dependency_job_id":null,"html_url":"https://github.com/10d9e/zk-pass","commit_stats":null,"previous_names":["jlogelin/zk_pass","10d9e/zk_pass","10d9e/zk-pass"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10d9e%2Fzk-pass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10d9e%2Fzk-pass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10d9e%2Fzk-pass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10d9e%2Fzk-pass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10d9e","download_url":"https://codeload.github.com/10d9e/zk-pass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565092,"owners_count":21125418,"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","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":["chaum-pedersen","cryptography","rust","zero-knowledge"],"created_at":"2025-04-12T12:16:56.546Z","updated_at":"2025-04-12T12:17:00.255Z","avatar_url":"https://github.com/10d9e.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZKPass 🔑\n\n[![build-badge](https://github.com/jlogelin/zk_pass/actions/workflows/build.yml/badge.svg)](https://nightly.link/jlogelin/zk_pass/workflows/build/main/binaries.zip)\n[![document-badge](https://github.com/jlogelin/zk_pass/actions/workflows/doc.yml/badge.svg)](https://jlogelin.github.io/zk_pass)\n[![license-badge](https://img.shields.io/badge/License-MIT-blue)](LICENSE)\n\n## Overview\nThe ZKPass server is a command-line application that facilitates a secret verification [Chaum-Pedersen protocol](PROTOCOL.md) service. It offers support for both Discrete Log and Elliptic Curve implementations of the protocol.\n\nThe following table shows the possible combinations of stereotype(discrete log and elliptic curve) group configurations:\n\n| Type              | Modp / Curve            |\n|-------------------|-------------------------|\n| discrete_log      | rfc5114_modp_1024_160   |\n| discrete_log      | rfc5114_modp_2048_224   |\n| discrete_log      | rfc5114_modp_2048_256   |\n| elliptic_curve    | ec25519                 |\n| elliptic_curve    | pallas                  |\n| elliptic_curve    | vesta                   |\n\nNote: This table shows a subset of possible combinations focusing on `type`, `curve`, and `modp` options as they must match between the server and client.\n\n## Quick Start\n\n0. **Install Prerequesites**\n   ```bash\n   brew install protoc\n   ```\n\n1. **Run the build**\n   Open a terminal and navigate to the root directory of the project.\n\n   ```bash\n   cd path/to/your/zk_pass\n   cargo build --release\n   ```\n2. **Start the server with default parameters**\n   ```bash\n   ❯ ./target/release/server\n   🔥 Starting ZK_PASS server 🔥\n         🤖 host: [::1]\n         🔌 port: 50051\n         💥 stereotype: discrete_log\n         🔢 modp group: rfc5114_modp_1024_160\n   ```\n\n3. **In another terminal send a request with the client using default parameters**\n   ```bash\n   ❯ ./target/release/client\n   🔥 Starting ZK_PASS client 🔥\n         🤖 host: [::1]\n         🔌 port: 50051\n         💥 stereotype: discrete_log\n         🔢 modp group: rfc5114_modp_1024_160\n         🔑 user: foo\n   🔑 Authentication successful! 🔑\n   Session ID: 97f6e2e1-19d5-404e-ad03-aa3a96d10fc1\n   ```\n4. **Read about more configuration options by asking for --help**\n\n  **Server:**\n   ```bash\n   ❯ ./target/release/server --help\n   server 0.1.0\n   A server for the ZKPass Chaum-Pedersen protocol service\n   \n   USAGE:\n       server [OPTIONS]\n   \n   FLAGS:\n           --help       Prints help information\n       -V, --version    Prints version information\n   \n   OPTIONS:\n       -c, --curve \u003ccurve\u003e    Command line option to set the elliptic curve type. Required if the stereotype is set to\n                              \"elliptic_curve\" [default: ec25519]  [possible values: ec25519, pallas, vesta]\n       -h, --host \u003chost\u003e      Command line option to set the host address for the server. Defaults to \"[::1]\" if not\n                              specified [default: [::1]]\n       -m, --modp \u003cmodp\u003e      Command line option to set the type of the RFC log group to use. Required if the stereotype\n                              is set to \"discrete_log\" [default: rfc5114_modp_1024_160]  [possible values:\n                              rfc5114_modp_1024_160, rfc5114_modp_2048_224, rfc5114_modp_2048_256]\n       -p, --port \u003cport\u003e      Command line option to set the port for the server. Defaults to 50051 if not specified\n                              [default: 50051]\n       -t, --type \u003ctype\u003e      Command line option to set the underlying type of the Chaum-Pedersen protocol to use\n                              [default: discrete_log]  [possible values: discrete_log, elliptic_curve]\n   ```\n\n   **Client:**\n   ```bash\n   ❯ ./target/release/client --help\n   client 0.1.0\n   A client for the ZKPass server\n   \n   USAGE:\n       client [OPTIONS]\n   \n   FLAGS:\n           --help       Prints help information\n       -V, --version    Prints version information\n   \n   OPTIONS:\n       -c, --curve \u003ccurve\u003e      Elliptic curve type for the Elliptic Curve implementation of Chaum-Pedersen [default:\n                                ec25519]  [possible values: ec25519, pallas, vesta]\n       -h, --host \u003chost\u003e        The host address of the ZKPass server [default: [::1]]\n       -m, --modp \u003cmodp\u003e        Type of RFC log group to use for the Discrete Log implementation of Chaum-Pedersen\n                                [default: rfc5114_modp_1024_160]  [possible values: rfc5114_modp_1024_160,\n                                rfc5114_modp_2048_224, rfc5114_modp_2048_256]\n       -p, --port \u003cport\u003e        The port number to connect to the ZKPass server [default: 50051]\n       -s, --secret \u003csecret\u003e    Optional secret passcode for authentication\n       -t, --type \u003ctype\u003e        Underlying type of the Chaum-Pedersen protocol to use [default: discrete_log]  [possible\n                                values: discrete_log, elliptic_curve]\n       -u, --user \u003cuser\u003e        Username for identification [default: foo]\n   ```\n\n\n# Docker\n\n### Running the docker-compose Setup\n\n1. **Navigate to Your Project Directory:**\n   Open a terminal and navigate to the root directory of the project, where the `docker-compose.yml` file is located.\n\n   ```bash\n   cd path/to/your/zk_pass\n   ```\n\n2. **Build the Docker Images:**\n   Run the following command to build the Docker images as defined in your `docker-compose.yml` file.\n\n   ```bash\n   docker-compose build\n   ```\n\n3. **Start the Services:**\n   To start the services (server and client containers) as defined in the `docker-compose.yml`, run:\n\n   ```bash\n   docker-compose up\n   ```\n\n4. **Shutting Down:**\n   When you're done, you can shut down the containers by pressing `Ctrl+C` in the terminal where `docker-compose up` is running. Alternatively, you can run the following command in another terminal (still in the project root):\n\n   ```bash\n   docker-compose down\n   ```\n\n### Building and Running the Container Integration Tests\n\nThere are a comprehensive set of dockerized tests for all of the different stereotype configutations. To run them\n\n0. **Make sure Docker is installed**\n\n1. **Navigate to Your Project Directory:**\n   Open a terminal and navigate to the root directory of the project.\n\n   ```bash\n   cd path/to/your/zk_pass\n   ```\n\n2. **Build the Test Container:**\n   Build the Docker image for your test container. Replace `test-container` with your desired image name.\n\n   ```bash\n   docker build -f docker/Dockerfile.test -t test-container .\n   ```\n\n3. **Run the Test Container:**\n   Once the build is complete, you can run the test container. This will execute the tests as defined in your test setup.\n\n   ```bash\n   docker run test-container\n   ```\n\nThe test will execute and validate the full set of integration test with the client and server, the output will look something like:\n\n```bash\n❯ docker run test-container\nTesting configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_1024_160\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_1024_160\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_1024_160\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: c78dd9a6-d8e7-4d5d-8ae3-84e4b3779a87\nTest passed for configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_1024_160\nTesting configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_2048_224\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_2048_224\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_2048_224\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: 6567c805-a57f-41e6-bd02-304b4c8b8b65\nTest passed for configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_2048_224\nTesting configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_1024_160\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_1024_160\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: discrete_log\n      🔢 modp group: rfc5114_modp_1024_160\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: 41560d5c-ca8e-49e5-8f2e-1d077b300dbf\nTest passed for configuration: type=discrete_log, curve=ec25519, modp=rfc5114_modp_1024_160\nTesting configuration: type=elliptic_curve, curve=ec25519, modp=rfc5114_modp_1024_160\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: ec25519\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: ec25519\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: a47b981e-2b85-4316-a573-d51bb4427e1d\nTest passed for configuration: type=elliptic_curve, curve=ec25519, modp=rfc5114_modp_1024_160\nTesting configuration: type=elliptic_curve, curve=pallas, modp=rfc5114_modp_1024_160\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: pallas\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: pallas\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: e03ee7b0-eae9-43de-816d-528e43aae8f2\nTest passed for configuration: type=elliptic_curve, curve=pallas, modp=rfc5114_modp_1024_160\nTesting configuration: type=elliptic_curve, curve=vesta, modp=rfc5114_modp_1024_160\n🔥 Starting ZK_PASS server 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: vesta\n🔥 Starting ZK_PASS client 🔥\n      🤖 host: 0.0.0.0\n      🔌 port: 50051\n      💥 stereotype: elliptic_curve\n      📈 elliptic curve: vesta\n      🔑 user: foo\n🔑 Authentication successful! 🔑\nSession ID: 227c090b-85dc-44b7-987a-091be0278248\nTest passed for configuration: type=elliptic_curve, curve=vesta, modp=rfc5114_modp_1024_160\nAll tests passed successfully!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10d9e%2Fzk-pass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10d9e%2Fzk-pass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10d9e%2Fzk-pass/lists"}