Challenge
1 | Our hot new cryptocurrency uses powerful techniques to make the asymmetric key signatures just as hard to crack on a quantum computer as a binary one. Maybe we forgot something though? Send some money to a weird address if you get any. |
Given : verifier.py, signatures.csv
There’re tons of signatures.
Those format is :identity | transaction msg | H1, H2, ..., H512 | Others
The part of others is made up of five to six [bit(0 or 1), sha256(?)]
In verifier.py
, I found it just do something to hash of transaction msg
(bit by bit).
1 | def msg_to_hashes(msg, signature): |
So, I take a look at signature.csv
and found no matter what transaction message is, H1
, H2
are
1 | 359d5317c1adc9f750ebcdbe6b02929bfc1f72bd92e67d00e4914b819524b743,a94058c640ab1fcb920da3056d7e518bc9cc7e886af7d389d71d754bb942fa65, |
or
1 | 2002f00883a023e155a08db1e87d17bc8004785194f527dff9e9a3453339f960,c5e01c06a18d7d4e1061ba3ab920988c5281cf48653a35757193239fc6956018, |
e.g. If the first bit is 0, H1
,H2
are
1 | 359d5317c1adc9f750ebcdbe6b02929bfc1f72bd92e67d00e4914b819524b743,a94058c640ab1fcb920da3056d7e518bc9cc7e886af7d389d71d754bb942fa65, |
else if the first bit is 1, then H1
,H2
are
1 | 2002f00883a023e155a08db1e87d17bc8004785194f527dff9e9a3453339f960,c5e01c06a18d7d4e1061ba3ab920988c5281cf48653a35757193239fc6956018, |
This seems determined by the hash of transaction message corresponding bit is 0 or 1.
Not only that, I also found out each transaction send by 9bca65c9376209ede04b5df3b02cb832f8997ff978069d171dc9cbfca657f91a
using the same value of others
to get the identity.
1 | [ |
Solution
Maybe …
If I use
9bca65c9376209ede04b5df3b02cb832f8997ff978069d171dc9cbfca657f91a
to send the transaction message.collect all corresponding hash value to make the right set of H1,H2,…H512 depends on the hash of transaction message.
Add that
others
behind it.
Then I will pass the veritify … ?
BINGO.
fb{reduce_reuse_recycle_is_bad_advice_for_ots}
After the game, I learned that this algorithm is called Lamport signature
or Lamport one-time signature
I hope this message helps xD.