{"id":19275534,"url":"https://github.com/matthiasgeihs/fhe_string","last_synced_at":"2025-10-04T22:25:23.370Z","repository":{"id":213089632,"uuid":"700856713","full_name":"matthiasgeihs/fhe_string","owner":"matthiasgeihs","description":"Encrypted strings for tfhe-rs.","archived":false,"fork":false,"pushed_at":"2024-02-04T01:04:37.000Z","size":124,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T14:51:26.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthiasgeihs.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":"2023-10-05T12:38:44.000Z","updated_at":"2024-03-01T03:27:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c8b7c5f-fa67-49dc-bbaa-8115a06e787d","html_url":"https://github.com/matthiasgeihs/fhe_string","commit_stats":null,"previous_names":["matthiasgeihs/fhe_string"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasgeihs%2Ffhe_string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasgeihs%2Ffhe_string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasgeihs%2Ffhe_string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasgeihs%2Ffhe_string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthiasgeihs","download_url":"https://codeload.github.com/matthiasgeihs/fhe_string/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240378929,"owners_count":19792040,"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":[],"created_at":"2024-11-09T20:51:03.016Z","updated_at":"2025-10-04T22:25:23.277Z","avatar_url":"https://github.com/matthiasgeihs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fhe_string\n\n`fhe_string` is a library for computing on encrypted strings.\n\n## Usage\nThe following code snippet demonstrates usage of the API.\n```rust\nuse fhe_string::{ClientKey, ServerKey, generate_keys, StringEncryption};\n\n// Generate keys.\nlet (client_key, server_key) = generate_keys();\n\n// Define inputs and compute `split` on cleartext.\nlet (input, sep) = (\"a,b,c\", \",\");\nlet result_clear = input.split(sep).collect::\u003cVec\u003c_\u003e\u003e();\n\n// Encrypt inputs (without padding).\nlet input_enc = input.encrypt(\u0026client_key, None).unwrap();\nlet sep_enc = sep.encrypt(\u0026client_key, None).unwrap();\n\n// Compute `split` on encrypted string and pattern.\nlet result_enc = input_enc.split(\u0026server_key, \u0026sep_enc);\n\n// Decrypt and compare result.\nlet result_dec = result_enc.decrypt(\u0026client_key);\nassert_eq!(result_dec, result_clear);\n```\n\n## Example `cmd`\n\nThe `cmd` example runs a number of string operations on encryptions of the given input string and pattern.\n```bash\ncargo run --example cmd --release -- --input \" A bcbc \" --pattern \"bc\"\n\n# list all options\ncargo run --example cmd --release -- --help\n```\n\n## Development\n\nIn the following we list commands useful during development.\n\n### Linting\n```bash\ncargo fmt\ncargo clippy\n```\n\n### Testing and performance evaluation\n```bash\n# all tests\ncargo test --release\n\n# all tests sequentially\ncargo test --release -- --test-threads=1\n\n# single test with log\nRUST_LOG=trace RUST_BACKTRACE=1 cargo test --release ciphertext::tests::insert::add -- --nocapture --exact\n\n# all tests with time measurement (nightly only)\ncargo test --release -- --test-threads=1 -Z unstable-options --report-time\n```\n\n### Docs generation and running doc tests\n```bash\n# generate docs\ncargo doc --no-deps --open\n\n# run doc tests\ncargo test --doc --release -- --show-output\n```\n\n## Acknowledgements\nThis project has been developed for the [Zama Bounty Program](https://github.com/zama-ai/bounty-program), specifically for the bounty [\"Create a string library that works on encrypted data using TFHE-rs\"](https://github.com/zama-ai/bounty-program/issues/80).\n\n## License\n\nSee [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasgeihs%2Ffhe_string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiasgeihs%2Ffhe_string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasgeihs%2Ffhe_string/lists"}