Hopefully, you have OpenSSL (and OpenSSH) installed on your target system. If so, you can use the openssl command to generate hashes for a quite a few different schemes.
There are a few different ways that you can run it:
- openssl <hash type> <file>
E.g. openssl md5 tarball.tar.gz
- cat <file> | openssl <hash type>
E.g. cat tarball.tar.gz | openssl md5
- cat <file> | openssl dgst <hash option>
E.g. cat tarball.tar.gz | openssl dgst -md5
Options 1 & 2, will only work for a limited set of hash types. As of writing, these are: md2, md4, md5, rmd160, sha, sha1.
You can list what the supported hash types are by running "openssl list-message-digest-commands".
Options 3 will work for hash types upto sha512. Check the man page on openssl for more detail. Or you can force the dgst subcommand to list its options with
"openssl dgst -?"
Update #1: I've changed option one so that's simpler, from openssl dgst <hash type> <file> to just openssl <hash type> file. I've also corrected the explanation of the options accordingly and expanded on them a bit.