{"id":22174333,"url":"https://github.com/brianschubert/purecipher","last_synced_at":"2025-07-26T15:32:04.625Z","repository":{"id":163004633,"uuid":"148225216","full_name":"brianschubert/purecipher","owner":"brianschubert","description":"Demonstration of exposing non-primitive data structures over a foreign function interface in Rust.","archived":false,"fork":false,"pushed_at":"2018-12-08T14:25:56.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2023-07-18T18:26:55.985Z","etag":null,"topics":["ffi","ffi-wrapper"],"latest_commit_sha":null,"homepage":"","language":"C","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/brianschubert.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":"2018-09-10T22:09:18.000Z","updated_at":"2023-07-18T18:26:58.155Z","dependencies_parsed_at":"2023-07-18T18:37:02.332Z","dependency_job_id":null,"html_url":"https://github.com/brianschubert/purecipher","commit_stats":null,"previous_names":["brianschubert/purecipher"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianschubert%2Fpurecipher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianschubert%2Fpurecipher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianschubert%2Fpurecipher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianschubert%2Fpurecipher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianschubert","download_url":"https://codeload.github.com/brianschubert/purecipher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227692269,"owners_count":17805174,"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":["ffi","ffi-wrapper"],"created_at":"2024-12-02T07:44:01.318Z","updated_at":"2024-12-02T07:44:01.912Z","avatar_url":"https://github.com/brianschubert.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purecipher\n\nA rust library implementing pure (stateless) ciphers.\n\nThis repository is intended to serve as a terse demonstration of exposing\nnon-primitive data structures over a foreign function interface with the Rust \nprogramming language.\n\npurecipher provides a succinct interface for manipulating trivial substitution \nciphers. The \"meat\" of this repository lies in the interface between the Rust \ncode the comprises the purecipher library and the C code that allows this \nlibrary to used by applications written in C, C++, Python, and other languages. \n\nThe libraries defined in this repository are not intended for practical \napplications and most definitely should not be used in place of conventional\ncryptographic libraries.\n\n## Usage\nTo incorporate the latest version of the purecipher library into a Rust crate, \nadd the following to the dependencies section of your `Cargo.toml` configuration:\n```toml\n[dependencies]\npurecipher = { git = \"https://github.com/blueschu/purecipher\" }\n```\n\nSince the purecipher library is designed to demonstrate the implementation of\nforeign function interfaces, it of course exposes a C API. This interface is \ndescribed by the C header file `./include/purecipher.h`. To use purecipher in a \nC project, simply `#include` this header file and ensure that the purecipher \nlibrary file is discoverable at link time. To use the purecipher library in a \nnon-C, non-Rust environment, you may either employ a language specific FFI \nlibrary or make use of one the wrapper libraries provided in the `./wrappers` \nof this repository. Usage instructions for each of these wrappers are \ndocumented in the `README.md` files  found in their respective source roots.\n\n## Building\nAll components of this repository can be built using CMake for convenience. To \nbuild all CMake targets, you may run the following.\n```bash\n$ mkdir -p cmake-build-debug\n$ cd !$\n$ cmake ..\n$ make\n```\nSpecific targets, (e.g. `purecipher` or `ctest`) may follow the `make` command \nabove to build only those targets. For a full listing of applicable targets, see\nthe `CMakeList.txt` files located throughout this repository. \n\nSystem dependencies for targets are documented in the `README` files located in \ntheir respective source root.\n\n## Testing\nEach component of this repository includes a set of unit tests. The procedure\nfor running these tests varies between components. Testing procedures for the\nmain rust library are documented below. For running unit tests against wrapper\nimplementations, see the `README` files in their source directory.\n\n### Rust Tests\nTo build and run the Rust unit tests, simply use cargo's `test` command:\n```bash\n$ cargo test\n```\n\n### C Tests\nTest cases for the C API exposed by the Rust crate may be found under the `ctest`\ndirectory. If you have already built all CMake targets, these tests can run with\n```bash\n$ ./cmake-build-debug/ctest/ctest\n```\nwhere `cmake-build-debug` is the build directory used by CMake.\n\nIf using CMake is not an option on your system, you may also compile the test \nsources by hand:\n```bash\n$ cd ctest\n$ cargo build --manifest-path ../Cargo.toml\n$ cc -o ctest test.c --std=c11 -Wall -I../include -L../target/debug -lpurecipher\n$ LD_LIBRARY_PATH=../target/debug ./ctest\n```\nwhere `cc` is a compatible C compiler of your choosing (e.g. `gcc`, `clang`).\n\n## Acknowledgments\nThe layout of this repository was inspired by the C API for the [Rust Regex Engine][rure].\n\n## Copyright \u0026 License\nCopyright \u0026copy; 2018 Brian Schubert - available under [MIT License][license].\n\n[rure]: https://github.com/rust-lang/regex/tree/master/regex-capi\n[license]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianschubert%2Fpurecipher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianschubert%2Fpurecipher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianschubert%2Fpurecipher/lists"}