Reputation: 52268
Is it possible to calculate a file's checksum without possessing the file?
I'm interested in creating some software that would be used to download external files. I must be careful, because the files can be altered by the file owners.
I would like to keep a list of checksum values inside the software, to allow the software to validate that the external file is what it claims to be.
I believe this is easily possible once the external file is stored locally (i.e. after it has been downloaded), but I would ideally like to calculate the checksum for the file before downloading. Is this possible?
Essentially I'm tying to get a file's checksum without actually possessing the file. I think that sounds impossible, but I'm new to checksums and may be missing obvious techniques.
Upvotes: 2
Views: 1414
Reputation: 3067
I'm not an expert, but here's an idea.
Make your file owners' clients (or the server that receives the files) upload the checksums (and any other metadata you need) of the files separately (as a different file, or a database entry). Then your software can download the checksum and verify it before downloading the bigger file.
Upvotes: 2