{"id":29128257,"url":"https://github.com/armanghobadi/uecdh","last_synced_at":"2026-04-28T13:34:08.257Z","repository":{"id":299076033,"uuid":"1001975145","full_name":"armanghobadi/uecdh","owner":"armanghobadi","description":"is a lightweight, standards-compliant Elliptic Curve Diffie-Hellman (ECDH) key exchange library for MicroPython, optimized for ESP32 and other resource-constrained IoT devices","archived":false,"fork":false,"pushed_at":"2025-06-14T14:38:28.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T14:39:04.881Z","etag":null,"topics":["cryptography","ecdh","esp32","microcontroller","micropyhton"],"latest_commit_sha":null,"homepage":"","language":"Python","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/armanghobadi.png","metadata":{"files":{"readme":"README.markdown","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,"zenodo":null}},"created_at":"2025-06-14T12:50:56.000Z","updated_at":"2025-06-14T14:38:31.000Z","dependencies_parsed_at":"2025-06-14T14:39:09.371Z","dependency_job_id":"ba88e0ba-6add-44df-8fb5-78d8f5bb6ec2","html_url":"https://github.com/armanghobadi/uecdh","commit_stats":null,"previous_names":["armanghobadi/uecdh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/armanghobadi/uecdh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fuecdh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fuecdh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fuecdh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fuecdh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armanghobadi","download_url":"https://codeload.github.com/armanghobadi/uecdh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fuecdh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262694480,"owners_count":23349854,"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":["cryptography","ecdh","esp32","microcontroller","micropyhton"],"created_at":"2025-06-30T01:37:52.247Z","updated_at":"2026-04-28T13:34:08.245Z","avatar_url":"https://github.com/armanghobadi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UECDH: Ultra ECDH Key Exchange Library 🚀🔒\n\n![MicroPython](https://img.shields.io/badge/MicroPython-v1.19+-blue) ![ESP32](https://img.shields.io/badge/ESP32-Supported-green) ![IoT](https://img.shields.io/badge/IoT-Secure-yellow)\n\n![UECDH](./Docs/imgs/logo/logo.png)\n\n**UECDH** is a lightweight, standards-compliant Elliptic Curve Diffie-Hellman (ECDH) key exchange library for MicroPython, optimized for ESP32 and other resource-constrained IoT devices. It enables secure key exchange for any communication protocol using X25519 + HKDF-SHA256. It is ideal for IoT applications requiring secure, low-power communication.\n\n---\n\n## English\n\n### Overview\n**UECDH** is a **battle-tested**, **constant-time**, **memory-safe** X25519 + HKDF-SHA256 implementation written purely in MicroPython – **no external dependencies**.  \nDesigned for ESP32 and any resource-constrained IoT device that needs secure ephemeral ECDH key exchange.\n\n\u003e **100 % production-ready** – passed all 7 rigorous tests on real hardware (v2.3.0-FINAL).  \n\u003e **Zero heap fragmentation** – works reliably on devices with less than 40 KB free RAM.\n\n**Standards compliance**  \n- RFC 7748 – X25519 key exchange  \n- RFC 5869 – HKDF-SHA256  \n- RFC 6090 – Additional X25519 validation checks  \n- NIST SP 800-56A Rev. 3 – Ephemeral ECDH  \n\n---\n\n## Features\n\n| Feature                        | Details                                                                                              |\n|--------------------------------|------------------------------------------------------------------------------------------------------|\n| **Curve**                      | X25519 (Montgomery ladder, full constant-time)                                                       |\n| **Key Derivation**             | HKDF-SHA256 with optional `salt`, `info`, arbitrary output length (`length=` parameter)            |\n| **Key Lengths**                | 16 B (128 bit), 32 B (256 bit), 64 B (512 bit) – any length up to 8 KB                               |\n| **Public-key validation**      | Rejects all low-order points, invalid encoding, out-of-range coordinates                            |\n| **Key lifetime**               | Automatic expiration after 1 hour (`MAX_LIFETIME = 3600 s`)                                          |\n| **Secure memory wipe**         | XOR-with-random + zero-fill + `gc.collect()` on every `clear()` and `__del__`                       |\n| **No secret-dependent branches**| Pure conditional-swap ladder – immune to timing attacks                                              |\n| **Hardware RNG**               | Uses ESP32 TRNG via `urandom.getrandbits()`                                                          |\n| **Test suite**                 | 7 automated tests covering every edge case – **100 % pass**                                          |\n\n\n\n### Installation\n1. **Flash MicroPython** on ESP32:\n   - Download the latest firmware from [micropython.org](https://micropython.org).\n   - Flash using `esptool`:\n     ```bash\n     esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32.bin\n\n\nRun tests:\n```python\nfrom tests.uint import test\n```\n![Unit Tests](./Docs/imgs/tests/test.png)\n\n\n\n### References\n- NIST SP 800-56A Rev. 3 (2020)\n- NIST SP 800-90A Rev. 1 (2015)\n- FIPS 180-4 (2015)\n- ISO/IEC 18033-3 (2010)\n- RFC 7748 – X25519 key exchange\n- RFC 5869 – HKDF-SHA256\n- RFC 6090 – Additional X25519 validation checks\n- NIST SP 800-56A Rev. 3 – Ephemeral ECDH\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmanghobadi%2Fuecdh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmanghobadi%2Fuecdh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmanghobadi%2Fuecdh/lists"}