Code Monkey home page Code Monkey logo

ecdsa-keyrec's Introduction

ecdsa-keyrec

Build Status

A python script enabling private key recovery from signatures by implementing an attack on ECDSA nonce-reuse.

Sample text, public key, and signed messages are given for test and example.

NB: beware of newlines if you're using files, and if you really want them there. Newlines in signature files might not be supported, you might as well strip them.

Needed package : ecdsa

pip3 install ecdsa

Usage and arguments:

$ python3 ecdsa-nonce_reuse-crack.py -h
usage: 

Retrieve ECDSA private key by exploiting a nonce-reuse in signatures.        

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           Do not output anything on terminal (but errors and   
                        exceptions may still be printed). Private key will be
                        printed in default file.
  -v, --verbosity       increase output verbosity
  -files                Specify this command if you want to read input from  
                        files.
  -cli                  Specify this command if you want to read values      
                        directly from cli.
  -hardcoded            Modify values inside this script to operate.
  -hardcoded-files      Modify file names inside this script to operate.     

-files:
  --pubkey PUBKEY       Path to the file containing a PEM encoded public key.
  --message1 MESSAGE1   Path to the text file containing the first message   
                        that has been signed.
  --message2 MESSAGE2   Path to the text file containing the second message  
                        that has been signed.
  --signature1 SIGNATURE1
                        Path to the text file containing the base64 encoded  
                        signature of the first message.
  --signature2 SIGNATURE2
                        Path to the text file containing the base64 encoded  
                        signature of the first message.
  --hashalg {sha1,sha224,sha256,sha384,sha512,md5}
                        Hash algorithm used for the signatures.
  --output OUTPUT       Output file to print the private key to.

-cli:
  -pk PK                PEM encoded public key.
  -m1 M1                First message that has been signed.
  -m2 M2                Second message that has been signed.
  -sig1 SIG1            Base64 encoded signature of the first message.       
  -sig2 SIG2            Base64 encoded signature of the first message.       
  -alg {sha1,sha224,sha256,sha384,sha512,md5}
                        Hash algorithm used for the signatures.
  -o O                  Output file to print the private key to.
  -r R                  First half of the signature that is common in both   
                        signatures.
  -s1 S1                Second half of the signature of first message.
  -s2 S2                Second half of the signature of second message.

ecdsa-keyrec's People

Contributors

bytemare avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ecdsa-keyrec's Issues

Nice

How can we input our own data to this program. I.e : RSZ sigs and public keys?

There's so many programs thats coded but use generators.. Which are pointless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.