{"id":20102302,"url":"https://github.com/isakruas/ecutils","last_synced_at":"2026-01-22T03:06:02.256Z","repository":{"id":57674119,"uuid":"417995453","full_name":"isakruas/ecutils","owner":"isakruas","description":"Python Library for Elliptic Curve Cryptography: key exchanges (Diffie-Hellman, Massey-Omura), ECDSA signatures, and Koblitz encoding. Suitable for crypto education and secure systems.","archived":false,"fork":false,"pushed_at":"2024-10-26T17:19:51.000Z","size":129,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-27T17:55:47.397Z","etag":null,"topics":["cryptographic-algorithms","diffie-hellman-key-exchange","digital-signatures","ecc-based-protocols","ecdsa","elliptic-curve-cryptography","elliptic-curve-operations","koblitz-encoding","massey-omura-protocol","message-encoding-and-decoding","public-key-cryptography","python-cryptography","secure-communication"],"latest_commit_sha":null,"homepage":"https://ecutils.readthedocs.io/en/stable/","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/isakruas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2021-10-17T02:08:14.000Z","updated_at":"2025-02-15T01:05:31.000Z","dependencies_parsed_at":"2024-04-09T23:29:51.842Z","dependency_job_id":"8dd66308-c793-4faf-89a9-61c7c1d80733","html_url":"https://github.com/isakruas/ecutils","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/isakruas/ecutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isakruas%2Fecutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isakruas%2Fecutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isakruas%2Fecutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isakruas%2Fecutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isakruas","download_url":"https://codeload.github.com/isakruas/ecutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isakruas%2Fecutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28651824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cryptographic-algorithms","diffie-hellman-key-exchange","digital-signatures","ecc-based-protocols","ecdsa","elliptic-curve-cryptography","elliptic-curve-operations","koblitz-encoding","massey-omura-protocol","message-encoding-and-decoding","public-key-cryptography","python-cryptography","secure-communication"],"created_at":"2024-11-13T17:29:42.778Z","updated_at":"2026-01-22T03:06:02.251Z","avatar_url":"https://github.com/isakruas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecutils\n\n**A Pythonic Elliptic Curve Cryptography Library**\n\n[![CI](https://github.com/isakruas/ecutils/actions/workflows/ci.yml/badge.svg)](https://github.com/isakruas/ecutils/actions/workflows/ci.yml)\n[![Documentation Status](https://readthedocs.org/projects/ecutils/badge/?version=latest)](https://ecutils.readthedocs.io/en/stable/?badge=latest)\n[![PyPI Version](https://img.shields.io/pypi/v/ecutils.svg)](https://pypi.python.org/pypi/ecutils/)\n[![PyPI Downloads](https://static.pepy.tech/badge/ecutils/month)](https://pepy.tech/project/ecutils)\n[![codecov](https://codecov.io/gh/isakruas/ecutils/branch/master/graph/badge.svg)](https://codecov.io/gh/isakruas/ecutils)\n\n`ecutils` is a pure Python library that provides a clean and straightforward interface for elliptic curve cryptography (ECC). Designed for educational purposes and for building secure systems, it implements common ECC operations, algorithms, and protocols with a focus on readability and ease of use.\n\n## Features\n\n- **Core Operations:** Point addition, doubling, and scalar multiplication on various curves.\n- **Standard Curves:** Pre-configured parameters for `secp192k1`, `secp192r1`, `secp224k1`, `secp224r1`, `secp256k1`, `secp256r1`, `secp384r1`, and `secp521r1`.\n- **Digital Signatures:** Implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).\n- **Key Exchange Protocols:** Secure key exchange using Diffie-Hellman (ECDH) and Massey-Omura.\n- **Message Encoding:** Koblitz's method for encoding messages to and from curve points.\n- **Performance:** Optimized with LRU cache and Jacobian (projective) coordinates for faster computations.\n- **Pure Python:** No external dependencies required.\n\n## Installation\n\nInstall `ecutils` directly from PyPI:\n\n```bash\npip install ecutils\n```\n\n## Quickstart: Digital Signatures (ECDSA)\n\nHere's a quick example of how to generate and verify a digital signature.\n\n```python\nimport hashlib\nimport secrets\nfrom ecutils.algorithms import DigitalSignature\n\n# 1. Generate a secure private key\n# In a real application, this should be a securely generated and stored key.\nprivate_key = secrets.randbits(256)\n\n# 2. Create a DigitalSignature instance\n# This automatically derives the public key.\nds = DigitalSignature(private_key, curve_name=\"secp256r1\")\n\n# 3. Prepare the message\n# Always hash the message before signing.\nmessage = b\"This is a message to be signed.\"\nmessage_hash = int.from_bytes(hashlib.sha256(message).digest(), \"big\")\n\n# 4. Generate the signature\nr, s = ds.generate_signature(message_hash)\nprint(f\"Signature: (r={r}, s={s})\")\n\n# 5. Verify the signature\n# This step would typically be done by the receiver, using the sender's public key.\nis_valid = ds.verify_signature(ds.public_key, message_hash, r, s)\n\nprint(f\"Signature is valid: {is_valid}\")\n# Output: Signature is valid: True\n```\n\nFor more examples, including key exchange and message encoding, please check out our full [**documentation**](https://ecutils.readthedocs.io/en/stable/).\n\n## Performance\n\nECUtils is optimized for performance using LRU caching and Jacobian coordinates. Here's a sample of signature operations on secp256r1:\n\n| Configuration | Signature Generation | Signature Verification |\n|---------------|---------------------|------------------------|\n| Jacobian + LRU Cache | 0.02 ms | 0.04 ms |\n| Jacobian (no cache) | 17.35 ms | 53.48 ms |\n| Affine + LRU Cache | 0.07 ms | 0.11 ms |\n| Affine (no cache) | 17.24 ms | 51.21 ms |\n\nFor complete benchmarks across all curves and operations, see the [Benchmarks documentation](https://ecutils.readthedocs.io/en/stable/benchmarks/).\n\n## Supported Curves\n\n| Curve | Key Size | Use Case |\n|-------|----------|----------|\n| secp192k1 | 192-bit | Legacy systems |\n| secp192r1 | 192-bit | Legacy systems |\n| secp224k1 | 224-bit | Moderate security |\n| secp224r1 | 224-bit | Moderate security |\n| secp256k1 | 256-bit | Bitcoin, Ethereum |\n| secp256r1 | 256-bit | TLS, general purpose |\n| secp384r1 | 384-bit | High security |\n| secp521r1 | 521-bit | Maximum security |\n\n## Documentation\n\n- [Installation Guide](https://ecutils.readthedocs.io/en/stable/installation/)\n- [Usage Examples](https://ecutils.readthedocs.io/en/stable/usage/)\n- [Configuration](https://ecutils.readthedocs.io/en/stable/configuration/)\n- [API Reference](https://ecutils.readthedocs.io/en/stable/reference/core/)\n- [Security Considerations](https://ecutils.readthedocs.io/en/stable/security/)\n- [Benchmarks](https://ecutils.readthedocs.io/en/stable/benchmarks/)\n\n## Contributing\n\nContributions are welcome! Please read our [contributing guidelines](https://github.com/isakruas/ecutils/blob/master/CONTRIBUTING.md) to get started.\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisakruas%2Fecutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisakruas%2Fecutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisakruas%2Fecutils/lists"}