{"id":22914061,"url":"https://github.com/ax1/electrocomms","last_synced_at":"2025-07-10T18:35:08.779Z","repository":{"id":86523254,"uuid":"519365575","full_name":"ax1/electrocomms","owner":"ax1","description":"Post-Quantum Communications for the ELECTRON european project","archived":false,"fork":false,"pushed_at":"2023-01-11T11:07:41.000Z","size":254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T20:26:48.790Z","etag":null,"topics":["energy","european-union","post-quantum"],"latest_commit_sha":null,"homepage":"https://electron-project.eu/","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/ax1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-29T22:37:40.000Z","updated_at":"2023-02-26T11:55:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bf7769b-1029-40af-b8f5-b66c40d4c0ba","html_url":"https://github.com/ax1/electrocomms","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":0.05660377358490565,"last_synced_commit":"ee623e0e76ead7a6b86c322ff51b44096dc2ce13"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ax1/electrocomms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax1%2Felectrocomms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax1%2Felectrocomms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax1%2Felectrocomms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax1%2Felectrocomms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ax1","download_url":"https://codeload.github.com/ax1/electrocomms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax1%2Felectrocomms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264631212,"owners_count":23640941,"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":["energy","european-union","post-quantum"],"created_at":"2024-12-14T05:13:07.728Z","updated_at":"2025-07-10T18:35:08.742Z","avatar_url":"https://github.com/ax1.png","language":"C","readme":"# Electrocomms\n\nProvide Quantum resistant communications without changing existing stacks.\n\nThis is part of the *STRONGBOX* component, into the WP4, in the [ELECTRON european project](https://electron-project.eu/). \n\n![](electrocomms.gif)\n\nSelected algorithms:\n- for the Post-Quantum asymmetric key exchange mechanism: Crystals-Kyber 1024\n- for the symmetric encryption with authentication enabled: ChaCha20-Poly1305\n\n## Demos\n\n\u003e See the [demo](/demo) folder containing code and documentation. \n\n\u003e A [Docker](/DOCKER) container is also available for quick tests.\n\n### Simple demo\n\nStarting as command line applications. The applications just exchange a shared key.\n\n```mermaid\nsequenceDiagram\n    Note left of PQ client: Public PQ key\n    Note right of PQ server: Private PQ key\n    PQ client-\u003e\u003ePQ server: Connect 8080\n    PQ client--\u003e\u003ePQ server: [OPTIONAL] Send temporary verification\n    Note left of PQ client: Shared key\n    PQ client-\u003e\u003ePQ client: Use public key\n    PQ client-\u003e\u003ePQ server: Send encapsulated key\n    PQ server-\u003e\u003ePQ server: Use private key\n    PQ server-\u003e\u003ePQ client: OK\n    Note right of PQ server: Shared key\n```\n\n### Integrated demo\n\nTwo systems exchanging data at port 8081. When a quantum-safe key is required, the systems call PQClient and PQServer to exchange a safe key over the port 8080. Then, these systems can encrypt and transmit data by using that shared key. Note also that Client and PQ client interaction (same with server) is always done locally.\n\n```mermaid\nsequenceDiagram\n    Participant Client A\n    Participant PQ client\n    Participant PQ server\n    Participant Server B\n    Client A-\u003e Server B: Normal connection (port 443 or 8081)\n    Client A-\u003e\u003ePQ client: Request shared key\n    PQ client-\u003ePQ server: Exchange shared key (port 8080)\n    Note over PQ client, PQ server: The quantum-safe encapsulation is transmitted, not the raw shared key.\n    PQ client-\u003e\u003eClient A: Return shared key\n    PQ server-\u003e\u003eServer B: Return shared key\n    loop\n    Client A-\u003e\u003eClient A: Encrypt data with shared key\n    Client A-\u003e\u003e Server B: Encrypted data\n    Server B-\u003e\u003eServer B: Decrypt data with shared key\n    end\n```\n\n## Usage\n\nDevelopers: Download source code, then execute `make` in the src folder.\nUsers: use a pre-compiled binary from /dist folder.\n\n\u003e Note: At this stage of the project, the public key is delivered only to allowed clients. See reasoning and alternatives [here](/README_DEVELOPMENT.md). \n\nTo display help: `./electrocomms`\n\nTo start the server: `./electrocomms 8080` (In the first run, a new pair of keys is generated automatically)\n\nTo start the client: `./electrocomms 127.0.0.1 8080`\n\n## Selection of the PQ alternatives\n\nThere are many approaches to Post-Quantum (PQ) communications. Each one of them has advantages but also important drawbacks.\n\n|Approach|Advantages|Disadvantages|\n|---|---|---|\n|OpenSSL fork with PQ|Versatility, PQ certificates instead of keys | No ROOT CA to sign certificate, slower than other options| not all chip architectures|not suitable for embedded|\n|Nginx fork with PQ|Server ready to use|Client must be also a PQ (new client or change the client stack)|\n|Pre shared Key (PSK) into TLS|Use only the external PQ for shared key. TLS1.3 already allow this|Existing programs may not have PSK as public method in code, so external implementation is still required|\n|Using Qdefender lib|Faster to develop|Qdefender license is Tecnalia proprietary for now|\n|Plain C implementation|Better suited for servers and embedded, open-source is possible|Only for simple scenarios, ad-hoc code|\n\nFor the Electron project, since many elements are not still defined, we will opt for the plain C implementation focused on server to server communication. Reasons:\n- if the C program is kept simple, it could be also used for low resources systems, with some effort. Other options will never be capable in embedded due to RAM, cycles or size of binary, compilation issues etc.\n-  external dependencies (algorithms) can be  linked as open-source. The project license can be set to Free and Open-Source Project (FOSS). This is a positive point for the European commission funding the Electron project.\n\n## Selection of the algorithms\n\nFor the asymmetric part (the key exchange mechanism or KEM), CRYSTALS-KYBER will be selected. Reasons:\n- Selected for standardization in the third round of NIST.\n- Lattice family performs really well in most architectures.\n\nFor the symmetric part [ONLY in the integrated demo by using Node] (the encryption of data to be transmitted securely) ChaCha20-Poly1305 is selected. Reasons:\n- Does not require hardware acceleration to be fast.\n- Since most of traditional HTTPs servers use AES-GCM, using a different algorithm for the app-level encryption increases the security.\n\n\n## Licenses\n\nAll licenses are permissive open-source, see LICENSE file on each subfolder:\n- current project: [MIT](/LICENSE)\n- Kyber implementation: [Creative Commons Zero CC0](/src/kyber1024/LICENSE)\n\n\n## Parent project\n\n**[ELECTRON \"rEsilient and seLf-healed EleCTRical pOwer Nanogrid\"](https://electron-project.eu/)**\n\nCall: H2020-SU-DS-2020, Topic: U-DS04-2018-2020, Start Date: 01/10/2021, Duration: 36 months.\n\nThis project has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 101021936.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax1%2Felectrocomms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fax1%2Felectrocomms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax1%2Felectrocomms/lists"}