Ok, well, I'm still not 100% on the end-to-end here, but there are definitely utilities that could help you if you wanted to do it in bash. For instance, you can use echo and md5sum to get the md5 hash of an arbitrary sequence of bytes:
Obviously you'd have to do more work to substitute the actual content at the beginning of the message, but that's beyond my bash skills (all the bash I need to know is just enough to invoke perl).
$ echo -n "<First 20 bytes><Block index>\x20\x43\x6F\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x30\x20\x41\x63\x74\x69\x76\x69\x73\x69\x6F\x6E\x2E\x20\x41\x6C\x6C\x20\x52\x69\x67\x68\x74\x73\x20\x52\x65\x73\x65\x72\x76\x65\x64\x2E\x20" | md5sum
I notice the apparently random string of bytes is actually a copyright notice. I don't know if what you're doing or plan to do qualifies as a copyright violation, but it's definitely something to be aware of.