I want to know if it is safe to hash a file in a non-sandbox environment.

3 Answers 3


Unless the target of the malicious file is the hash program itself, it is safe, because the file is only use through it. And hashing program are normally simple enough to not suffer from such vulnerabilities. So IMHO it is safe if you use a command line hashing program.

  • "Unless the target of the malicious file is the hash program itself" is why I voted for this answer
    – niilzon
    Jun 14, 2017 at 10:34

Hashing just reads the file and does not execute it. If in doubt make the file none executable.


I don't know of any hashing program which would require to execute the file being hashed. It should be safe enough. Just to be sure, make the file as read-only and put it through the hashing program.

Alternatively, you can upload the file to virustotal.com. It hashes the file to some popular formats like MD5, SHA1, SHA256.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.