GithubHelp home page GithubHelp logo

r4yan2 / fastgcd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d-o-c/fastgcd

0.0 2.0 0.0 1.45 MB

Fastgcd is a C implementation of an efficient algorithm to compute the pairwise GCDs of a collection of integers. The algorithm is due to Bernstein and is a simplified version of (http://cr.yp.to/papers.html#smoothparts).

License: GNU General Public License v3.0

Makefile 1.67% C 89.90% Shell 8.43%

fastgcd's Introduction

fastgcd
-------

Nadia Heninger
J. Alex Halderman

Fastgcd is a C implementation of an efficient algorithm to compute the pairwise
GCDs of a collection of integers.  The algorithm is due to Bernstein and is a
simplified version of (http://cr.yp.to/papers.html#smoothparts).

The input to the program is a file listing the collection of integers (e.g.,
RSA moduli).  The algorithm will compute the GCD of each input integer with the
product of every other input integer, and output the nontrivial common divisors
along with a list of input integers which had a nontrivial common divisor.  In
the simplest case for RSA moduli, the common divisor will be a single prime
factor.  We leave it as an exercise to deal with cases where the divisor is
composite.

This program was used in "Mining your Ps and Qs: Detection of Widespread Weak
Keys in Network Devices" to discover weak RSA keys. For more information, and a
copy of the paper, see https://factorable.net/


Install
-------

To install fastgcd (in current directory), simply run

./install.sh

The install script will download and install a local copy of gmp-5.0.5 and
extract and apply our patch to GMP.  This patch modifies GMP to add an integer
output format that can accommodate integers larger than 2^32 bytes, which is
necessary for large inputs to the algorithm.  This means that the temporary
files written to disk in the course of the algorithm by our patched GMP are not
compatible with the standard GMP output format.

Running
-------

To run a fresh instance of fastgcd, use

./fastgcd input.moduli

On completion, fastgcd will output:

vulnerable_moduli       - list of moduli that had a nontrivial common divisor
                          with any input modulus, in hex, one per line.

gcds                    - list of the common divisor of each modulus in 
                          vulnerable_moduli with the product of every other 
                          modulus in input.moduli, in hex, one per line.


We have provided a sample input:
input.moduli            - list of moduli, in hex, one per line. Note: these
                          must be unique.

Sample output produced by running fastgcd on the provided input.moduli file are
contained in sample.out/.

fastgcd's People

Contributors

d-o-c avatar pseudo2 avatar

Watchers

James Cloos avatar  avatar

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.