09-05-2011 07:58 AM
I'm trying to find a way to checksum a file on OpenVMS 7.3 that can be copied to a windows machine (windows server 2008) and checksum verified. Something like MD5 checksum would be great.
I'm not great on VMS, so all help is much appreciated.
Regards and thanks, Niall
09-05-2011 08:36 AM - edited 09-05-2011 08:40 AM
It'd be effective to simply zip the files and transfer them over, and let zip and unzip deal with the integrity checking, if that's the goal here, and depending on what you are seeking to protect against. Here are details on zip and unzip on VMS.
MD5 is discussed at various sites, and there are OpenVMS discussions including Security Tips: Integrity, CHECKSUM, MD5 and Cryptographic Digests, with those including specific steps specific to building MD5 from source code on certain OpenVMS configurations, or you can download pre-built files (if you are willing to trust those) from OpenVMS Freeware V8.0 at various sites, including at Digiater.
MD5 is a cryptographically insecure hash, so using a newer and more secure checksum is typical when security is a concern. (There are various reasons to use MD5, including protection against innocent corruptions and protection against attack. MD5 works for the former, but would not be my choice for the latter.)
As for Windows MD5 tools (or unzip, for that matter), you'll want to go ask in a Microsoft Windows forum.
edit: for completeness, newer VMS versions have a CHECKSUM command that (also) supports MD5. The version of CHECKSUM on your version (which was undocumented back then) is based on XOR; there's probably a tool around that can implement that XOR over on Windows (but I'm not familiar with it) or you could reverse-engineer the XOR and write one. Details in the CHECKSUM article above.
09-05-2011 12:30 PM
Perl 5.10 and later come with the shasum utility, which would be one handy way to do it.
$ shasum -h Usage: shasum [OPTION]... [FILE]... Print or check SHA checksums. With no FILE, or when FILE is -, read standard input. -a, --algorithm 1 (default), 224, 256, 384, 512, 512224, 512256 -b, --binary read in binary mode -c, --check read SHA sums from the FILEs and check them -p, --portable read files in portable mode produces same digest on Windows/Unix/Mac -t, --text read in text mode (default) The following two options are useful only when verifying checksums: -s, --status don't output anything, status code shows success -w, --warn warn about improperly formatted checksum lines -h, --help display this help and exit -v, --version output version information and exit When verifying SHA-512/224 or SHA-512/256 checksums, indicate the algorithm explicitly using the -a option, e.g. shasum -a 512224 -c checksumfile The sums are computed as described in FIPS-180-4. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating type (`*' for binary, ` ' for text, `?' for portable), and name for each FILE. Report shasum bugs to firstname.lastname@example.org
09-05-2011 04:33 PM
Thanks Hoff for your response. I have installed ZIP already, but it doesn't have a checksum option. The checksum is simply to verify that the file transfered 100% correctly, before attempting to process it. I do see that Gzip has a checksum option so i might try this. I also saw GnuPG as an option, but gzip looks to be the easier of the two to install.
Thanks again for your response. Niall
09-05-2011 09:19 PM
> I'm trying to find a way to checksum a file on OpenVMS 7.3 that can be copied to a windows machine
This may depend on the type of file you want to transfer. For example, a "text" file may be in VAR or VFC record format on VMS, but will be silently converted to STM or STM_LF record format when copied elsewhere. If your checksum utility includes meta data, the two versions of the file will generate different checksums.