{"id":24093731,"url":"https://github.com/lattice-based-cryptography/module-lwe","last_synced_at":"2025-02-27T11:58:41.205Z","repository":{"id":269733251,"uuid":"908276504","full_name":"lattice-based-cryptography/module-lwe","owner":"lattice-based-cryptography","description":"Implementation of module-LWE encryption method in Rust.","archived":false,"fork":false,"pushed_at":"2025-02-18T19:02:24.000Z","size":47,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T19:39:39.623Z","etag":null,"topics":["lattice-based-cryptography","module-lwe","rust"],"latest_commit_sha":null,"homepage":"","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/lattice-based-cryptography.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-25T16:52:01.000Z","updated_at":"2025-02-11T19:02:13.000Z","dependencies_parsed_at":"2024-12-25T18:24:40.880Z","dependency_job_id":"7ddf253c-abd5-4a9b-b65e-51fafa678921","html_url":"https://github.com/lattice-based-cryptography/module-lwe","commit_stats":null,"previous_names":["lattice-based-cryptography/module-lwe"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lattice-based-cryptography%2Fmodule-lwe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lattice-based-cryptography%2Fmodule-lwe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lattice-based-cryptography%2Fmodule-lwe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lattice-based-cryptography%2Fmodule-lwe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lattice-based-cryptography","download_url":"https://codeload.github.com/lattice-based-cryptography/module-lwe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241008961,"owners_count":19893259,"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":["lattice-based-cryptography","module-lwe","rust"],"created_at":"2025-01-10T10:34:12.722Z","updated_at":"2025-02-27T11:58:41.200Z","avatar_url":"https://github.com/lattice-based-cryptography.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# module-LWE\n\n![example workflow](https://github.com/lattice-based-cryptography/module-lwe/actions/workflows/basic.yml/badge.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n[![Crates.io](https://img.shields.io/crates/v/module-lwe.svg)](https://crates.io/crates/module-lwe)\n\nImplmentation of lattice-based encryption method module-LWE in pure Rust.\n\n**Description**: This provides the basic PKE (keygen, encryption, and decryption) operations for the module learning-with-errors scheme.\n\n**Disclaimer**: This is not secure. It is not written in constant-time nor resistant to other side-channel attacks. This is intended for educational use and not for real-world applications.\n\n**Usage**: In the `src` directory,\n\n`cargo build`\n\nTo build the binary.\n\n`cargo test`\n\n- Performs keygen/encrypt/decrypt for a test message.\n- Checks homomorphic addition and multiplcation hold for small values.\n\n_Note_: Parameters optional via \n\n- `--params \u003cn\u003e \u003cq\u003e \u003ck\u003e`\n\nwhere `n` is polynomial degree, `q` is modulus, `k` is the module rank.\n\nIf ommitted, the default parameters will be used.\n\n`cargo run -- keygen`\n\nThis will generate a public/secret keypair. \n\n`cargo run -- encrypt \u003cpublic_key\u003e \u003cmessage\u003e`\n\nGenerates the ciphertext.\n\n`cargo run -- decrypt \u003csecret_key\u003e \u003cciphertext\u003e`\n\nDecrypts the ciphertext given a secret key, printing the plaintext message.\n\n**Benchmarks**:\n\n| n   | q     | k | keygen    | encrypt   | decrypt   | keygen_string | encrypt_string | decrypt_string |\n|-----|-------|---|-----------|-----------|-----------|---------------|----------------|----------------|\n| 256 | 12289 | 2 | 146.66 µs | 194.11 µs | 61.535 µs | 230.43 µs     | 255.60 µs      | 88.291 µs      |\n| 256 | 12289 | 4 | 562.56 µs | 622.29 µs | 118.37 µs | 819.22 µs     | 787.60 µs      | 167.38 µs      |\n| 384 | 12289 | 4 | 1.1774 ms | 1.3473 ms | 260.02 µs | 1.5546 ms     | 1.5829 ms      | 332.87 µs      |\n| 512 | 12289 | 4 | 1.1959 ms | 1.3597 ms | 260.77 µs | 1.7172 ms     | 1.6976 ms      | 356.75 µs      |\n| 512 | 12289 | 8 | 4.6993 ms | 4.8762 ms | 518.81 µs | 6.4127 ms     | 5.7918 ms      | 677.05 µs      |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flattice-based-cryptography%2Fmodule-lwe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flattice-based-cryptography%2Fmodule-lwe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flattice-based-cryptography%2Fmodule-lwe/lists"}