r/crypto • u/Round_Ad_5832 • 20h ago
Experiment: Turning Speck128/256 into a secure hash function using Hirose's construction
If we were to use Davies–Meyer to turn Speck, a tiny cipher that still hasn't been broken to this day, into a hash function, at most we would get 16 bytes of output and that's not usable (a collision takes only about 2⁶⁴ tries). But running a variant of Hirose's double-block-length construction, we are able to get 32 bytes and aim for security comparable to SHA-256.
Speck's initial design was never in-mind for hashing, which is what makes this experimental. So this comes unreviewed, but I am putting this hash into the public to see if it holds up. So here is SpeckHashX: https://github.com/multipleof4/SpeckHashX
Also: it is capable of variable output below or above 32 bytes, but keep in mind longer output does not add strength, and shorter outputs are weaker.
There are npm and Rust packages available for anyone interested in trying it.