"I want my crc32 to be 802892ef ..."
Well, I thought it was interesting, so today I have encoded a small java program for searching for collisions. Thought I'd leave it here if someone found this useful:
import java.util.zip.CRC32; public class Crc32_recurse2 { public static void main(String[] args) throws InterruptedException { long endval = Long.parseLong("ffffffff", 16); long startval = 0L;
Exit:
49.825756% through - done 2140M so far - 1731000 tested per second - 1244s till the last value. 50.05859% through - done 2150M so far - 1770000 tested per second - 1211s till the last value. Match found!!! Message is: I wish my crc32 was 802892ef... crc32 of message is 802892ef
Note that the dots at the end of the message are actually part of the message.
On my i5-2500, it took you ~ 40 minutes to find the entire crc32 space from 00000000 to ffffffff, doing about 1.8 million tests per second. This maximized one core.
I am new to Java, so any constructive comments on my code will be appreciated.
"My crc32 was c8cb204, and all I got was this lousy t-shirt!"
localhost Mar 11 '13 at 13:31 on 2013-03-11 13:31
source share