Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. tiny-ECDH-c

tiny-ECDH-c

UnlicenseC

A minimal, portable C implementation of Elliptic-Curve Diffie-Hellman for secure key exchange.

GitHubGitHub
297 stars69 forks0 contributors

What is tiny-ECDH-c?

Tiny-ECDH-c is a minimal, portable C implementation of the Elliptic-Curve Diffie-Hellman key agreement algorithm. It allows two parties to establish a shared cryptographic secret over insecure channels using elliptic-curve cryptography, with a focus on small code size and no external dependencies.

Target Audience

Embedded systems developers, IoT engineers, and anyone needing lightweight cryptographic key exchange in resource-constrained C environments.

Value Proposition

It offers the smallest known ECC implementation in C, is public domain, supports multiple standard curves, and requires zero internal memory allocation—making it ideal for systems where code size and portability are critical.

Overview

Small portable Elliptic-Curve Diffie-Hellman in C

Use Cases

Best For

  • Adding ECDH key exchange to embedded firmware
  • Implementing secure communication in IoT devices with limited resources
  • Educational projects learning about elliptic-curve cryptography
  • Prototyping cryptographic protocols in C without heavy libraries
  • Systems requiring public-domain cryptographic code
  • Applications where minimal ROM/RAM usage is a priority

Not Ideal For

  • Projects requiring ECDSA digital signatures for authentication
  • Applications that need built-in random number generation for key creation
  • Systems where a comprehensive, audited cryptographic library is mandatory for compliance
  • Teams looking for active community support and frequent feature updates

Pros & Cons

Pros

Extremely Small Footprint

Compiles to only 2.1K ROM for ARM with zero internal RAM allocation, as demonstrated in the README's size report for embedded systems.

Portable and Dependency-Free

Written in standard C with no external dependencies, making it easy to integrate into various projects, including resource-constrained environments.

Multiple Standard Curves

Supports 10 NIST curves offering 80 to 256 bits of security, providing flexibility for different security needs, as listed in ecdh.h.

Simple and Clear API

Exposes just two functions—ecdh_generate_keys() and ecdh_shared_secret()—simplifying implementation, with examples in ecdh_example.c.

Public Domain Licensing

All material is in the public domain, allowing unrestricted use in any project without legal concerns, as stated in the README.

Cons

Limited Cryptographic Features

Only implements ECDH; ECDSA for signing is listed as a TODO, making it unsuitable for applications requiring digital signatures.

Manual Randomness Management

Users must provide their own random data for private keys, which can be error-prone and requires secure external random number generation.

Basic Security Protections

No built-in protection against out-of-bounds memory access from malicious input, as the README warns, limiting its use in high-security contexts.

Sparse Documentation

Beyond basic examples, the README lacks detailed tutorials or best practices for secure integration, which could hinder adoption.

Frequently Asked Questions

Quick Stats

Stars297
Forks69
Contributors0
Open Issues15
Last commit4 years ago
CreatedSince 2017

Tags

#c-library#ecdh#public-domain#embedded#lightweight#c#ecc#security#cryptography#public-key-cryptography#diffie-hellman#key-exchange#elliptic-curve

Built With

C
C++

Included in

C/C++70.6k
Auto-fetched 8 hours ago

Related Projects

OpenSSLOpenSSL

General purpose TLS and crypto library

Stars30,764
Forks11,451
Last commit18 hours ago
libsodiumlibsodium

A modern, portable, easy to use crypto library.

Stars13,939
Forks1,886
Last commit1 day ago
TinkTink

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Stars13,535
Forks1,189
Last commit2 years ago
mbedTLSmbedTLS

An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.

Stars6,948
Forks2,964
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub