Re: Checksum utility (377 Views)
Reply
Frequent Advisor
Niall76
Posts: 51
Registered: ‎07-04-2007
Message 1 of 7 (413 Views)

Checksum utility

Hi,

 

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

Please use plain text.
Honored Contributor
Hoff
Posts: 4,929
Registered: ‎01-29-2006
Message 2 of 7 (411 Views)

Re: Checksum utility

[ Edited ]

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.

Please use plain text.
Honored Contributor
Craig A Berry
Posts: 494
Registered: ‎05-06-2003
Message 3 of 7 (396 Views)

Re: Checksum utility

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 mshelor@cpan.org

 

Please use plain text.
Frequent Advisor
Niall76
Posts: 51
Registered: ‎07-04-2007
Message 4 of 7 (389 Views)

Re: Checksum utility

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

Please use plain text.
Frequent Advisor
Niall76
Posts: 51
Registered: ‎07-04-2007
Message 5 of 7 (388 Views)

Re: Checksum utility

Arragh! I've never used perl and don't have it installed. But if all else fails it certainly an option. thanks.
Please use plain text.
Honored Contributor
Hoff
Posts: 4,929
Registered: ‎01-29-2006
Message 6 of 7 (385 Views)

Re: Checksum utility

zip and unzip uses crc32 checksum to check the archive.

Please use plain text.
Honored Contributor
John Gillings
Posts: 2,994
Registered: ‎07-31-2003
Message 7 of 7 (377 Views)

Re: Checksum utility

Niall,

 

> 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.

A crucible of informative mistakes
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation