How do you embed a hash into a file recursively?
- by oasisbob
Simplest case: You want to make a text file which says "The MD5 hash of this file is FOOBARHASH". How do you embed the hash, knowing that the embedded hash value and the hash of the file are inter-related?
eg, Cisco embeds hash values into their IOS images, which can be verified like this:
cisco# verify s72033-advipservicesk9_wan-mz.122-33.SXH7.bin
Embedded Hash MD5 : D2BB0668310392BAC803BE5A0BCD0C6A
Computed Hash MD5 : D2BB0668310392BAC803BE5A0BCD0C6A
IIRC, Ubuntu also includes a txt file in the root of their ISOs which have the hash of the entire ISO.
Maybe I'm mistaken, but trying to figure out how to do this blows my mind.