New answers tagged


Here's a cyclic group of any order $q \ge 1$: Identity: $0$. Generator: $1$. Group operation: $a \cdot b$ is (a + b) % q.


To find a collision it would be best to perform a birthday attack (as I already commented below the question). You could use abc123 as prefix and then append a counter (using any encoding), creating the message to hash. Then you'd calculate a hash over the message and take the first 4 bytes. You'd create a map using the 4 byte hash as key (e.g. encoded as ...


It is possible to find 2 strings with the same first 32 bits sha1. For example, the first 32 bits of the sha1 of the hex strings 616263313233bffa0000 and 616263313233e6280100 are both e5c993e0. You can use a birthday attack. substring(0,32) gives you the first 32 bytes. You want the first 32 bits or the first 8 bytes. You should use substring(0,8).


As I read the comments on your question, I felt like I might react to it, even though it is not a formal answer. First, you seemed to wonder why you got some downvotes - I agree that downvoting without explaining why is far from useful. So, let me try to explain what might have provoked those negative reactions in your questions (I'm not saying that this ...

Top 50 recent answers are included