yugt / sha256-prefix-collision Goto Github PK
View Code? Open in Web Editor NEWSHA256 prefix collision (quarter of full length)
License: Other
SHA256 prefix collision (quarter of full length)
License: Other
This search algorithm can be adapted to run on GPU to speed up the SHA256 calculation.
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]
.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.