CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

crc32

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sgs
Guest







crc32
PostPosted: Tue Feb 09, 2010 3:45 am     Reply with quote

Pls help...

I have a crc32 value - 04c11db7.
I want to find out the 32 bit data whose crc32 value is the above.

Thanks in advance.
Ttelmah
Guest







PostPosted: Tue Feb 09, 2010 5:16 am     Reply with quote

Impossible.
Without knowing the length of the data, there are an infinite number of solutions.
Even with the data length, depending on the length, there will be numerous solutions (rising as the length increases)...
Think of the CRC, as effectively selecting one in 4294967296 possibilities.
Out of the entire number 'line', this represents an infinite number of possibilities. Even if you limit the line to just a 256byte value, you still have over 4E298 possibilities.
Worse, unless you know the exact CRC algorithm used, you have no starting point at all...

Best Wishes
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Tue Feb 09, 2010 5:44 am     Reply with quote

Sorry Ttelma, I think you missed the bit where he said 32bit value Smile

Anyway, they way I would try it is get a routine to calculate the CRC32 and then write the following code:-

Code:

int32 num;

for(num = 0; num < 0xFFFFFFFF; num++)
{
  if (crc32(num) == 0x04c11db7)
    printf("%X", num);
}


Not sure how long it would take but you could write a similar routine to run on your PC, may be quicker Smile
Ttelmah
Guest







PostPosted: Tue Feb 09, 2010 6:12 am     Reply with quote

I did.
But even then, it completely depends on the CRC algorithm used. People talk as if 'CRC32' is a standard. However, there are potentially an almost infinite number of possible CRC32 forms. In common use, there is CRC32 IEEE 802.3, which is used in networking, but there is also CRC32 ISO (HDLC), CRC32 ECMA, A version used in aviation, and the Koopman (rare) and Castagnoli (used in SCSI, and MPEG) forms.
If the CRC algorithm, is 'perfect', for a 32bit number, there would be just one solution, but few are....

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group