Git Product home page Git Product logo

sha256-prefix-collision's People

Contributors

yugt avatar

Watchers

 avatar

sha256-prefix-collision's Issues

Trie data structure

Current data structure uses C++ STL std::unordered_map which uses hash table. This can be suboptimal.

Trie data structure insertion and look-up time complexity are both O(log(n)) where n is the length of prefix, and for 16 hex-digit prefix, this can be treated as constant time, and may be faster than std::unordered_map by a constant factor.

How to run a.out after compiling and what does argv[1] mean?

argv[1] is the first character of input text (of length 6). For example,
./a.out z
finds the prefix collisions where
SHA256(z?????)[0:16] == SHA256(z?????)[0:16]
where ? represents a character among {0, ..., 9, A, ..., Z, a, ..., z} (Shell convention for single wildcard and Python convention for slicing).
Moreover,
./a.out y
finds the prefix collisions where
SHA256(y?????)[0:16] == SHA256(y?????)[0:16] and SHA256(y?????)[0:16] == SHA256(z?????)[0:16].

Similarly,
./a.out x
finds the prefix collisions where
SHA256(x?????)[0:16] == SHA256(x?????)[0:16] and
SHA256(x?????)[0:16] == SHA256(y?????)[0:16] and
SHA256(x?????)[0:16] == SHA256(z?????)[0:16].

So on so forth.

A corollary is that ./a.out z runs for shortest time while ./a.out 0 runs for the longest time since it needs to find prefix collisions where
SHA256(0?????)[0:16] == SHA256(0?????)[0:16] and
SHA256(0?????)[0:16] == SHA256(1?????)[0:16]
...
SHA256(0?????)[0:16] == SHA256(y?????)[0:16] and
SHA256(0?????)[0:16] == SHA256(z?????)[0:16].

GPU implementation

This search algorithm can be adapted to run on GPU to speed up the SHA256 calculation.

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.