securitychecksumdata-integrity

File containing its own checksum


Is it possible to create a file that will contain its own checksum (MD5, SHA1, whatever)? And to upset jokers I mean checksum in plain, not function calculating it.


Solution

  • I created a piece of code in C, then ran bruteforce for less than 2 minutes and got this wonder:

    The CRC32 of this string is 4A1C449B
    

    Note the must be no characters (end of line, etc) after the sentence.

    You can check it here: https://gchq.github.io/CyberChef/#recipe=CRC_Checksum('CRC-32',%7B'option':'Decimal','string':'0'%7D,%7B'option':'Hex','string':'0'%7D,%7B'option':'Hex','string':'0'%7D,'True','True',%7B'option':'Hex','string':'0'%7D)&input=VGhlIENSQzMyIG9mIHRoaXMgc3RyaW5nIGlzIDRBMUM0NDlC

    This one is also fun:

    I killed 56e9dee4 cows and all I got was...
    

    Source code (sorry it's a little messy) here: http://www.latinsud.com/pub/crc32/