문제

I need the checksum of an XML file in order to verify that no changes have been made to the file.

Once I have created the MD5 checksum is it possible to 'embed' the MD5 checksum inside the very same file. I guess not but perhaps if it is possible to make a partial checksum not based on the first X characters of the file.

Thank you very much...

도움이 되었습니까?

해결책

You can embed an MD5 hash in the file. This will change the hash of the file, but this can be overcome by reversing the modification before verifying the hash, being very careful of course to exactly reverse the operation.

However this doesn't offer any real security because if someone changes the file they just need to remember to change the hash value too.

You should instead generate a keypair and use a digital signature.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top