ecdsa-python | A lightweight and fast pure Python ECDSA library | Download Utils library

 by   starkbank Python Version: v2.2.0 License: MIT

kandi X-RAY | ecdsa-python Summary

kandi X-RAY | ecdsa-python Summary

ecdsa-python is a Python library typically used in Utilities, Download Utils applications. ecdsa-python has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install ecdsa-python' or download it from GitHub, PyPI.

We tried other Python libraries such as python-ecdsa, fast-ecdsa and other less famous ones, but we didn't find anything that suited our needs. The first one was pure Python, but it was too slow. The second one mixed Python and C and it was really fast, but we were unable to use it in our current infrastructure, which required pure Python code. For this reason, we decided to create something simple, compatible with OpenSSL and fast using elegant math such as Jacobian Coordinates to speed up the ECDSA. Starkbank-ECDSA is fully compatible with Python2 and Python3.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ecdsa-python has a low active ecosystem.
              It has 97 star(s) with 32 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 12 have been closed. On average issues are closed in 85 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ecdsa-python is v2.2.0

            kandi-Quality Quality

              ecdsa-python has 0 bugs and 0 code smells.

            kandi-Security Security

              ecdsa-python has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ecdsa-python code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ecdsa-python is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ecdsa-python releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              ecdsa-python saves you 315 person hours of effort in developing the same functionality from scratch.
              It has 758 lines of code, 84 functions and 23 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed ecdsa-python and discovered the below as its top functions. This is intended to give you an instant insight into ecdsa-python implemented functionality, and help decide if they suit your requirements.
            • Generate a public key from a string
            • Returns True if p is contained within this region
            • Matrix multiplication
            • Creates a Point from Jacobian
            • Verify a message
            • Sign a message using a private key
            • Construct a private key from a string
            • Parse a hexadecimal string
            • Return the data for a tag
            • Return a curve by oid
            • Generate a Key object from a string
            • Construct a Certificate from a string
            • Parse a hexadecimal integer
            • Read content of a file
            Get all kandi verified functions for this library.

            ecdsa-python Key Features

            No Key Features are available at this moment for ecdsa-python.

            ecdsa-python Examples and Code Snippets

            Sample Code
            Pythondot img1Lines of Code : 58dot img1License : Permissive (MIT)
            copy iconCopy
            from json import dumps
            from ellipticcurve.ecdsa import Ecdsa
            from ellipticcurve.privateKey import PrivateKey
            
            
            # Generate privateKey from PEM string
            privateKey = PrivateKey.fromPem("""
                -----BEGIN EC PARAMETERS-----
                BgUrgQQACg==
                -----END E  
            OpenSSL
            Pythondot img2Lines of Code : 29dot img2License : Permissive (MIT)
            copy iconCopy
            openssl ecparam -name secp256k1 -genkey -out privateKey.pem
            openssl ec -in privateKey.pem -pubout -out publicKey.pem
            
            openssl dgst -sha256 -sign privateKey.pem -out signatureDer.txt message.txt
            
            from ellipticcurve.ecdsa import Ecdsa
            from ellipticcurv  
            Run unit tests
            Pythondot img3Lines of Code : 2dot img3License : Permissive (MIT)
            copy iconCopy
            python3 -m unittest discover
            python2 -m unittest discover
              

            Community Discussions

            Trending Discussions on ecdsa-python

            QUESTION

            Invalid JWT signature with ES256
            Asked 2021-Feb-25 at 15:47

            I'm trying to manually create an ES256 JWT token. I've a small script written in python which signs a sha256 hash which uses ecdsa-python. But the signature is invalid on jwt.io.

            Steps to reproduce:

            1. Create base64 header + payload:

            eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0

            1. Create SHA256 hash from the base64 header + payload:

            FFC89E33091FFDD3C61798A0A74BF7C2D1A6FD231A6CB519F33952F7696BBE9F

            1. Generate ec_private key:

            openssl ec -in ec_private.pem -noout -text

            1. Use the small python program to ecdsa sign the SHA256 hash
            ...

            ANSWER

            Answered 2021-Feb-25 at 15:47

            The library you are using hashes implicitly, applying SHA1 by default. I.e. for compatibility with ES256 SHA256 must be explicitly specified and the unhashed JWT must be used, e.g.:

            Source https://stackoverflow.com/questions/66349140

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ecdsa-python

            To install StarkBank`s ECDSA-Python, run:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/starkbank/ecdsa-python.git

          • CLI

            gh repo clone starkbank/ecdsa-python

          • sshUrl

            git@github.com:starkbank/ecdsa-python.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Download Utils Libraries

            Try Top Libraries by starkbank

            ecdsa-php

            by starkbankPHP

            sdk-node

            by starkbankJavaScript

            ecdsa-java

            by starkbankJava

            ecdsa-dotnet

            by starkbankC#

            sdk-php

            by starkbankPHP