lie to server about md5sum of a file
7 hours ago, babadoctor said:or somehow calculate the hash of the file incrementally as it is created?
Depends on how you're creating the file. To calculate the hash, the file is read from beginning to end and fed through the hash algorithm. If you're creating the file programmatically you can absolutely generate the hash while you're writing it to a file, by feeding the bits through the hash digest as you're writing the bits to disk.
For example, the server can do this while it is receiving the file. As the file is written to disk, it can also send the stream through the hash algorithm at the same time. Unfortunately the sender can't do that because you need to present the MD5 to the server as a header before the file is sent, otherwise you could generate it as you're going over the file to send it.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now