ecutils


Nameecutils JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryElliptic Curve Utils
upload_time2024-04-22 17:18:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords ec ecdh ecdsa eck ecmo ecutils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Elliptic Curve Utils (ecutils)
[![Documentation Status](https://readthedocs.org/projects/ecutils/badge/?version=latest)](https://ecutils.readthedocs.io/en/latest/?badge=latest)
[![Latest Version](https://img.shields.io/pypi/v/ecutils.svg?style=flat)](https://pypi.python.org/pypi/ecutils/)
[![Downloads](https://static.pepy.tech/badge/ecutils)](https://pepy.tech/project/ecutils)
[![Downloads](https://static.pepy.tech/badge/ecutils/month)](https://pepy.tech/project/ecutils)
[![Downloads](https://static.pepy.tech/badge/ecutils/week)](https://pepy.tech/project/ecutils)
[![codecov](https://codecov.io/gh/isakruas/ecutils/branch/master/graph/badge.svg)](https://codecov.io/gh/isakruas/ecutils)

Elliptic Curve Utils, or `ecutils`, is a Python package that provides utilities for working with elliptic curves, particularly in the context of cryptography. It includes functionality for operations like point addition and scalar multiplication on curves, as well as higher-level protocols like key exchange and digital signatures.

## Features

- Implements common elliptic curve operations such as point addition and multiplication.
- Provides classes for encoding/decoding textual messages to and from elliptic curve points (e.g., Koblitz encoding).
- Supports several standardized elliptic curves including secp192k1, secp256r1, and secp521r1.
- Includes an implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) for signing messages and verifying signatures.
- Features key exchange protocols like Diffie-Hellman and Massey-Omura over elliptic curves.

## Installation

You can install the `ecutils` package using `pip`:

```bash
pip install ecutils
```

## Usage

### Encoding and Decoding Messages with Koblitz

```python
from ecutils.algorithms import Koblitz

# Initialize Koblitz with a specific curve
koblitz = Koblitz(curve_name="secp256k1")

# Encode a message to a curve point
point, j = koblitz.encode("Hello, World!")

# Decode the curve point back to a message
decoded_message = Koblitz.decode(point, j)
```

### Digital Signatures with ECDSA

```python
from ecutils.algorithms import DigitalSignature

# Create a DigitalSignature instance with your private key
ds = DigitalSignature(private_key=123456)

# Hash of your message
message_hash = hash('your message')

# Generate signature
r, s = ds.generate_signature(message_hash)

# Verify signature (typically on the receiver's side)
is_valid = ds.verify_signature(ds.public_key, message_hash, r, s)
```

### Diffie-Hellman Key Exchange

```python
from ecutils.protocols import DiffieHellman

# Alice's side
alice = DiffieHellman(private_key=12345)

# Bob's side
bob = DiffieHellman(private_key=67890)

# Alice computes her shared secret with Bob's public key
alice_shared_secret = alice.compute_shared_secret(bob.public_key)

# Bob computes his shared secret with Alice's public key
bob_shared_secret = bob.compute_shared_secret(alice.public_key)

# alice_shared_secret should be equal to bob_shared_secret
```

## Documentation

For more in-depth use and examples, check out the [official documentation](https://ecutils.readthedocs.io/en/latest/).

## Support

For issues, questions, or contributions, please refer to the project's [GitHub repository](https://github.com/isakruas/ecutils).

## License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).

Don't forget to give this project a star if you find it useful! 🌟

## Cross-Platform Compiled Library

In addition to this Python module, there exists a cross-platform compiled library that offers similar functionalities. This library is available under the [Apache Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) license and can be found on the official website:

[ecutils - software distribution](https://d3llw48k0uhrwl.cloudfront.net/)

If you need an implementation outside of the Python environment or seek integration with other programming languages, this library might be an excellent alternative.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ecutils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Isak Paulo de Andrade Ruas <isakruas@gmail.com>",
    "keywords": "ec, ecdh, ecdsa, eck, ecmo, ecutils",
    "author": null,
    "author_email": "Isak Paulo de Andrade Ruas <isakruas@gmail.com>, Celimar Reijane Alves Damasceno Paiva <celimar.damasceno@ifnmg.edu.br>, Fernando Marcos Souza Silva <fernando.silva@ifnmg.edu.br>",
    "download_url": "https://files.pythonhosted.org/packages/32/3b/6736b780f020856c7e60f59b288e9b28ee90b12538fa02c9c0c716a5f129/ecutils-1.0.0.tar.gz",
    "platform": null,
    "description": "# Elliptic Curve Utils (ecutils)\n[![Documentation Status](https://readthedocs.org/projects/ecutils/badge/?version=latest)](https://ecutils.readthedocs.io/en/latest/?badge=latest)\n[![Latest Version](https://img.shields.io/pypi/v/ecutils.svg?style=flat)](https://pypi.python.org/pypi/ecutils/)\n[![Downloads](https://static.pepy.tech/badge/ecutils)](https://pepy.tech/project/ecutils)\n[![Downloads](https://static.pepy.tech/badge/ecutils/month)](https://pepy.tech/project/ecutils)\n[![Downloads](https://static.pepy.tech/badge/ecutils/week)](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\nElliptic Curve Utils, or `ecutils`, is a Python package that provides utilities for working with elliptic curves, particularly in the context of cryptography. It includes functionality for operations like point addition and scalar multiplication on curves, as well as higher-level protocols like key exchange and digital signatures.\n\n## Features\n\n- Implements common elliptic curve operations such as point addition and multiplication.\n- Provides classes for encoding/decoding textual messages to and from elliptic curve points (e.g., Koblitz encoding).\n- Supports several standardized elliptic curves including secp192k1, secp256r1, and secp521r1.\n- Includes an implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) for signing messages and verifying signatures.\n- Features key exchange protocols like Diffie-Hellman and Massey-Omura over elliptic curves.\n\n## Installation\n\nYou can install the `ecutils` package using `pip`:\n\n```bash\npip install ecutils\n```\n\n## Usage\n\n### Encoding and Decoding Messages with Koblitz\n\n```python\nfrom ecutils.algorithms import Koblitz\n\n# Initialize Koblitz with a specific curve\nkoblitz = Koblitz(curve_name=\"secp256k1\")\n\n# Encode a message to a curve point\npoint, j = koblitz.encode(\"Hello, World!\")\n\n# Decode the curve point back to a message\ndecoded_message = Koblitz.decode(point, j)\n```\n\n### Digital Signatures with ECDSA\n\n```python\nfrom ecutils.algorithms import DigitalSignature\n\n# Create a DigitalSignature instance with your private key\nds = DigitalSignature(private_key=123456)\n\n# Hash of your message\nmessage_hash = hash('your message')\n\n# Generate signature\nr, s = ds.generate_signature(message_hash)\n\n# Verify signature (typically on the receiver's side)\nis_valid = ds.verify_signature(ds.public_key, message_hash, r, s)\n```\n\n### Diffie-Hellman Key Exchange\n\n```python\nfrom ecutils.protocols import DiffieHellman\n\n# Alice's side\nalice = DiffieHellman(private_key=12345)\n\n# Bob's side\nbob = DiffieHellman(private_key=67890)\n\n# Alice computes her shared secret with Bob's public key\nalice_shared_secret = alice.compute_shared_secret(bob.public_key)\n\n# Bob computes his shared secret with Alice's public key\nbob_shared_secret = bob.compute_shared_secret(alice.public_key)\n\n# alice_shared_secret should be equal to bob_shared_secret\n```\n\n## Documentation\n\nFor more in-depth use and examples, check out the [official documentation](https://ecutils.readthedocs.io/en/latest/).\n\n## Support\n\nFor issues, questions, or contributions, please refer to the project's [GitHub repository](https://github.com/isakruas/ecutils).\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n\nDon't forget to give this project a star if you find it useful! \ud83c\udf1f\n\n## Cross-Platform Compiled Library\n\nIn addition to this Python module, there exists a cross-platform compiled library that offers similar functionalities. This library is available under the [Apache Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) license and can be found on the official website:\n\n[ecutils - software distribution](https://d3llw48k0uhrwl.cloudfront.net/)\n\nIf you need an implementation outside of the Python environment or seek integration with other programming languages, this library might be an excellent alternative.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Elliptic Curve Utils",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/isakruas/ecutils/issues",
        "Changelog": "https://github.com/isakruas/ecutils/blob/master/CHANGELOG.md",
        "Documentation": "https://ecutils.readthedocs.io/en/latest/",
        "Homepage": "https://ecutils.readthedocs.io/en/latest/",
        "Repository": "https://github.com/isakruas/ecutils.git"
    },
    "split_keywords": [
        "ec",
        " ecdh",
        " ecdsa",
        " eck",
        " ecmo",
        " ecutils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e73b735c727ee3054ab08e385b6102673eff18665195415d86e5e856749abb9",
                "md5": "e55e3d00f024d3c68f498ed90e0b2edd",
                "sha256": "0d20457ab73c923cd7af9788691a4c5ff44edcb50df3951b1d8afa500333a715"
            },
            "downloads": -1,
            "filename": "ecutils-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e55e3d00f024d3c68f498ed90e0b2edd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10761,
            "upload_time": "2024-04-22T17:17:59",
            "upload_time_iso_8601": "2024-04-22T17:17:59.127837Z",
            "url": "https://files.pythonhosted.org/packages/5e/73/b735c727ee3054ab08e385b6102673eff18665195415d86e5e856749abb9/ecutils-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "323b6736b780f020856c7e60f59b288e9b28ee90b12538fa02c9c0c716a5f129",
                "md5": "6c7dc725857b2bf5a32e6802ed032c6a",
                "sha256": "e472e524ae669ccdfeaf6e7665bc69da38ad5b8a4213d1fd8ad0a9cc900db64a"
            },
            "downloads": -1,
            "filename": "ecutils-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6c7dc725857b2bf5a32e6802ed032c6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 29553,
            "upload_time": "2024-04-22T17:18:01",
            "upload_time_iso_8601": "2024-04-22T17:18:01.891732Z",
            "url": "https://files.pythonhosted.org/packages/32/3b/6736b780f020856c7e60f59b288e9b28ee90b12538fa02c9c0c716a5f129/ecutils-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 17:18:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "isakruas",
    "github_project": "ecutils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ecutils"
}
        
Elapsed time: 0.24510s