{"id":26092891,"url":"https://github.com/election-tech-initiative/electionguard-cpp","last_synced_at":"2026-03-03T03:05:00.518Z","repository":{"id":37078653,"uuid":"261481978","full_name":"Election-Tech-Initiative/electionguard-cpp","owner":"Election-Tech-Initiative","description":"A C++ implementation of ElectionGuard specification focused on encryption components. ","archived":false,"fork":false,"pushed_at":"2024-09-03T21:31:25.000Z","size":2138,"stargazers_count":24,"open_issues_count":45,"forks_count":25,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-04T07:08:28.442Z","etag":null,"topics":["cpp","csharp","electionguard","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://www.electionguard.vote/","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/Election-Tech-Initiative.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-05T13:39:02.000Z","updated_at":"2025-02-18T09:22:26.000Z","dependencies_parsed_at":"2024-12-03T17:46:15.187Z","dependency_job_id":"ab2e79be-0ab4-486b-9e4d-fe17a5df75d1","html_url":"https://github.com/Election-Tech-Initiative/electionguard-cpp","commit_stats":null,"previous_names":["election-tech-initiative/electionguard-cpp"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Election-Tech-Initiative%2Felectionguard-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Election-Tech-Initiative%2Felectionguard-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Election-Tech-Initiative%2Felectionguard-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Election-Tech-Initiative%2Felectionguard-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Election-Tech-Initiative","download_url":"https://codeload.github.com/Election-Tech-Initiative/electionguard-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248536096,"owners_count":21120681,"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":["cpp","csharp","electionguard","hacktoberfest"],"created_at":"2025-03-09T11:10:20.721Z","updated_at":"2026-03-03T03:05:00.461Z","avatar_url":"https://github.com/Election-Tech-Initiative.png","language":"C++","readme":"![Microsoft Defending Democracy Program: ElectionGuard Python][banner image]\n\n# 🗳 ElectionGuard C++\n\n[![ElectionGuard Specification 0.95.0](https://img.shields.io/badge/🗳%20ElectionGuard%20Specification-0.95.0-green)](https://www.electionguard.vote) ![Github Package Action](https://github.com/microsoft/electionguard-cpp/workflows/Release/badge.svg) [![license](https://img.shields.io/github/license/microsoft/electionguard-cpp)](https://github.com/microsoft/electionguard-cpp/blob/main/LICENSE) [![license](https://img.shields.io/nuget/v/Electionguard.Encryption)](https://www.nuget.org/packages/ElectionGuard.Encryption/)\n\nThis repository is a \"reference implementation\" of an ElectionGuard ballot encryption library written in c++ and includes a C-compatible API for referencing the library from pure-c application. This core SDK performs ballot encryption and verification functions and is suitable for execution on voting system hardware and low powered devices. It is designed to be integrated into existing (or new) voting system software.\n\nThis repository is `pre-release` software to showcase the ElectionGuard API implemented in a native language. It is not feature complete and should not be used for production applications.\n\n## 📁 In This Repository\n\n| File/folder                            | Description                                |\n| -------------------------------------  | ------------------------------------------ |\n| [`.github`](.github)                   | Github workflows and issue templates       |\n| [`.vscode`](.vscode)                   | VS Code configurations                     |\n| [`/bindings`](/bindings)               | Binding interfaces for different languages |\n| [`/cmake`](/cmake)                     | `CMake` dependencies`                      |\n| [`/include`](/include)                 | Public include headers                     |\n| [`/src`](/src)                         | ElectionGuard source code                  |\n| [`/test`](/test)                       | Unit tests                                 |\n| [`.clang-format`](.clang-format)       | Style guidelines                           |\n| [`.gitignore`](.gitignore)             | Define what to ignore at commit time.      |\n| [`CMakeLists.txt`](CMakeLists.txt)     | Root CMake file                            |\n| [`CONTRIBUTING.md`](CONTRIBUTING.md)   | Guidelines for contributing to the sample. |\n| [`README.md`](README.md)               | This README file.                          |\n| [`LICENSE`](LICENSE)                   | The license for the sample.                |\n\n## ❓ What Is ElectionGuard?\n\nElectionGuard is an open source software development kit (SDK) that makes voting more secure, transparent and accessible. The ElectionGuard SDK leverages homomorphic encryption to ensure that votes recorded by electronic systems of any type remain encrypted, secure, and secret. Meanwhile, ElectionGuard also allows verifiable and accurate tallying of ballots by any 3rd party organization without compromising secrecy or security.\n\nLearn More in the [ElectionGuard Repository](https://github.com/microsoft/electionguard)\n\n## 🦸 How Can I use ElectionGuard?\n\nElectionGuard supports a variety of use cases. The Primary use case is to generate verifiable end-to-end (E2E) encrypted elections. The ElectionGuard process can also be used for other use cases such as privacy enhanced risk-limiting audits (RLAs). This implementation only includes encryption functions and cannot be used to generate election keys and it cannot decrypt tally results.\n\nThis c++ implementation also includes a C API that can be consumed from anywhere that can call C code directly. A .Net Standard package is also provided.\n\n## 💻 Requirements\n\n### All Platforms\n\n- A [C++17](https://isocpp.org/get-started) standard compliant compiler is required to build the core library. While any modern compiler should work, the library is tested on a subset. Check out the [GitHub actions](#) to see what is officially supported.\n- [GNU Make](https://www.gnu.org/software/make/manual/make.html) is used to simplify the commands and GitHub Actions. This approach is recommended to simplify the command line experience. This is built in for MacOS and Linux. For Windows, setup is simpler with [Chocolatey](https://chocolatey.org/install) and installing the provided [make package](https://chocolatey.org/packages/make). The other Windows option is [manually installing make](http://gnuwin32.sourceforge.net/packages/make.htm).\n- [CMake](https://cmake.org/) is used to simplify the build experience.\n\n### 🤖 Android\n\nTo build for android, you need the Android SDK and platforms 21 and 26. The easiest way is to download android studio. Alternatively, you can use the SDK installation that ships with the Xamarin Tooling in Visual Studio. WE also require the use of the Android NDK. Android builds can be compiled on Linux, Mac, or Windows\n\n- [Android SDK](https://developer.android.com/studio/#downloads)\n- [SDK 21](https://developer.android.com/studio/releases/platforms#5.0)\n- [SDK 26](https://developer.android.com/studio/releases/platforms#8.0)\n- [NDK 21](https://developer.android.com/ndk/downloads/)\n\n### 🍏 iOS\n\nTo build for iOS you need XCode installed\n\n- [XCode](https://developer.apple.com/xcode/resources/) and the [Command Line Tools for XCode](#)\n- [CMake 3.19](https://cmake.org/) may be necessary, along with changes to the Makefile. [See ISSUE #138](https://github.com/microsoft/electionguard-cpp/issues/138)\n\n### Linux\n\nThe automated install of dependencies is currently only supported on debian-based systems. See the makefile for more information.\n\n### 🖥️ Windows (using MSVC)\n\nBuilding on windows is supported using the `MSVC` toolchain.\n\n- Install [Chocolatey](https://chocolatey.org/install)\n- Install [Powershell Core](https://github.com/powershell/powershell)\n- Install [VS 2019](https://visualstudio.microsoft.com/vs/)\n- Open the Visual Studio Installer and install\n  -- MSVC v142 - VS 2019 C++ x64/x86 build tools\n  -- Windows 10 SDK (latest)\n  -- C++ CMake tools for Windows\n  -- C++/CLI support for v142 build tools\n\n### 🖥️ Windows (using MSYS2)\n\nBuilding on windows is supported using the `MSYS2` toolchain. MSYS is the default toolchain on Windows.\n\n- Install [Chocolatey](https://chocolatey.org/install)\n- Install [Powershell Core](https://github.com/powershell/powershell)\n- Install [MSYS2](https://www.msys2.org)\n- Open the MSYS2 prompt by running the newly-created \"MSYS2 MSYS\" shortcut in your start menu.\n- Inside the prompt, run `pacman -Syu`, then close the window when it prompts you to.\n- Reopen the MSYS2 prompt and run:\n  ```\n  pacman -Syu\n  pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make\n  ```\n- Modify your `%Path%` to include the newly-installed software. You should include these two paths:\n  ```\n  C:\\msys64\\mingw64\\bin\n  C:\\msys64\\usr\\bin\n  ```\n\n#### 🚧 The Procedure Entry Point Could not be Located\n\nWhen compiling with shared libraries, you may encounter an error running the unit tests project. This is likely due to windows resolving the incorrect implementation of `libstdc++-6.dll`. Solving this depends on your use case, but you can either ensure that the path modifications made above appear before any other paths which include this library (e.g. c\\Windows\\System32\\), or you can include a copy of the correct DLL in the output folder. [See this StackOverflow post for more information](https://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located)\n\n### 🌐 .NET Standard\n\nA .NET Standard binding library is provided so that this package can be consumed from C# applications. At this time, MacOS, Linux and Windows are supported.\n\n- [Latest DotNet SDK](https://dotnet.microsoft.com/download)\n- [Visual Studio](https://visualstudio.microsoft.com)\n- [NuGet Command Line (CLI)](https://docs.microsoft.com/en-us/nuget/reference/nuget-exe-cli-reference#macoslinux)\n- On Linux, you need [Mono](https://www.mono-project.com/download/stable/)\n\n## Build C++\n\nUsing **make**,\n\n### Download Dependencies\n\n```sh\nmake environment\n```\n\n### Build the Library for the current host (Release, default toolchain)\n\n```sh\nmake build\n```\n\n### Build the Library for the current host (Debug, default toolchain)\n\n```sh\nexport TARGET=Debug \u0026\u0026 make build\n```\n\n### Android\n\nThe Android Build currently Targets API Level 26 but can be configured by modifying the Makefile\n\nSet the path to the NDK, replacing the version with your own\n\n```sh\nexport NDK_PATH=/Users/$USER/Library/Android/sdk/ndk/21.3.6528147 \u0026\u0026 make build-android\n```\n\n### iOS\n\nThe iOS build currently targets iPhone OS 12 but can be configured by modifying the Makefile\n\nCreates a fat binary for the simulator and targets a recent version of iOS\n\n```sh\nmake build-ios\n```\n\n### Windows\n\nUsing the default MSYS2 toolchain:\n\n```pwsh\nmake build\n```\n\nUsing the MSVC toolchain:\n\n```pwsh\nmake build-msvc\n```\n\n## Build Wrappers\n\n### .Net Standard 2.0\n\nWraps the build artifacts in a C# wrapper conforming to .Net Standard 2.0.\n\n```sh\nmake build-netstandard\n```\n\n### .Net Framework v4.8\n\nWraps the MSVC build artifacts in a C++/CLI wrapper to be consumed from a .Net Framework 4.8 application (windows desktop only). Only works on Windows.\n\n```pwsh\n// ensure the windows msvc binaries are built\nmake build-msvc\n```\n\nopen `./bindings/netframework//ElectionGuard.NetFramework/ElectionGuard.NetFramework.XXX.sln` in VS 2019 and build.\n\n#### Running the .Net Framework Benchmark\n\nOpen the NetFramework solution and run the `ElectionGuard.Bench` project\n\n## Test\n\n### Running the C++ and C tests\n\n```sh\nmake test\n```\n\n#### Running the tests on Windows using the MSVC toolchain\n\n```sh\nmake test-msvc\n```\n\n### Running the netstandard tests\n\nTo run the tests when building for the current host (Linux, Mac, windows:)\n\n```sh\nmake build-netstandard\nmake test-netstandard\n```\n\nTo run the tests when building for a mobile device, you can run the .Net Standard tests using the Xamarin Test runner on the Android Emulator or the iOS simulator:\n\n**NOTE: Xamarin build support is temporarily disabled while the project migrates to the new SDK style project format.**  Please refer to ISSUE #195 for more information.\n\n```sh\nmake build-netstandard\n```\n\nThen, open Visual studio for Mac and run the `ElectionGuard.Tests.Android` or `ElectionGuard.Tests.iOS` project.\n\n## 📄 Documentation\n\n## Contributing\n\nThis project encourages community contributions for development, testing, documentation, code review, and performance analysis, etc. For more information on how to contribute, see [the contribution guidelines][contributing]\n\n### Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n### Reporting Issues\n\nPlease report any bugs, feature requests, or enhancements using the [GitHub Issue Tracker](https://github.com/microsoft/electionguard-python/issues). Please do not report any security vulnerabilities using the Issue Tracker. Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). See the [Security Documentation][security] for more information.\n\n### Have Questions?\n\nElectionGuard would love for you to ask questions out in the open using GitHub Discussions. If you really want to email the ElectionGuard team, reach out at electionguard@microsoft.com.\n\n## License\n\nThis repository is licensed under the [MIT License]\n\n## Thanks! 🎉\n\nA huge thank you to those who helped to contribute to this project so far, including:\n\n**[Josh Benaloh _(Microsoft)_](https://www.microsoft.com/en-us/research/people/benaloh/)**\n\n\u003ca href=\"https://www.microsoft.com/en-us/research/people/benaloh/\"\u003e\u003cimg src=\"https://www.microsoft.com/en-us/research/wp-content/uploads/2016/09/avatar_user__1473484671-180x180.jpg\" title=\"Josh Benaloh\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Keith Fung](https://github.com/keithrfung) [_(InfernoRed Technology)_](https://infernored.com/)**\n\n\u003ca href=\"https://github.com/keithrfung\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/10125297?v=4\" title=\"keithrfung\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Matt Wilhelm](https://github.com/AddressXception) [_(InfernoRed Technology)_](https://infernored.com/)**\n\n\u003ca href=\"https://github.com/AddressXception\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6232853?s=460\u0026u=8fec95386acad6109ad71a2aad2d097b607ebd6a\u0026v=4\" title=\"AddressXception\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Dan S. Wallach](https://www.cs.rice.edu/~dwallach/) [_(Rice University)_](https://www.rice.edu/)**\n\n\u003ca href=\"https://www.cs.rice.edu/~dwallach/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/743029?v=4\" title=\"danwallach\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Marina Polubelova](https://polubelova.github.io/) [_(INRIA Paris)_](https://prosecco.gforge.inria.fr/)**\n\n\u003ca href=\"https://polubelova.github.io/\"\u003e\u003cimg src=\"https://polubelova.github.io/authors/admin/avatar_hu562f921c0165de84dfdc53044b574fa1_846381_270x270_fill_q90_lanczos_center.jpg\" title=\"polubelova\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Santiago Zanella-Béguelin](https://www.microsoft.com/en-us/research/people/santiago/) [_(Microsoft Research)_](https://www.microsoft.com/en-us/research/)**\n\n\u003ca href=\"https://www.microsoft.com/en-us/research/people/santiago/\"\u003e\u003cimg src=\"https://www.microsoft.com/en-us/research/uploads/prod/2020/08/profile_cropped-5f44d9b09ecd7.jpg\" title=\"santiago\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n**[Jonathan Protzenko](https://jonathan.protzenko.fr/) [_(Microsoft Research)_](https://www.microsoft.com/en-us/research/group/research-software-engineering-rise/)**\n\n\u003ca href=\"https://jonathan.protzenko.fr/\"\u003e\u003cimg src=\"https://jonathan.protzenko.fr/assets/protzenko.jpg\" title=\"protzenko\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n\u003c!-- Links --\u003e\n\n[banner image]: https://raw.githubusercontent.com/microsoft/electionguard-python/main/images/electionguard-banner.svg\n[pull request workflow]: https://github.com/microsoft/electionguard-ccpp/blob/main/.github/workflows/pull_request.yml\n[contributing]: https://github.com/microsoft/electionguard-cpp/blob/main/CONTRIBUTING.md\n[security]: https://github.com/microsoft/electionguard-cpp/blob/main/SECURITY.md\n[mit license]: https://github.com/microsoft/electionguard-cpp/blob/main/LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felection-tech-initiative%2Felectionguard-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felection-tech-initiative%2Felectionguard-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felection-tech-initiative%2Felectionguard-cpp/lists"}