Operating System - HP-UX
1752782 Members
6507 Online
108789 Solutions
New Discussion юеВ

How to create SHA512 file hash

 
so.nimda
Super Advisor

How to create SHA512 file hash

Hi,

Would someone be able to advise how I can create a SHA512 hash for a data file e.g. csv?

We are doing some data transfer (automated) and would like to have this hash to ensure the integrity of the data file that is being sent over.

What I have read and found online so far relates to hashing of passwords and not on data files.

Is it doable?

Thanks in advance.

 

 

4 REPLIES 4
Steven Schweda
Honored Contributor

Re: How to create SHA512 file hash

> [...] how I can create a SHA512 hash for a data file e.g. csv?

   You could use OpenSSL.  For example (here, on a VMS system, but it's
portable, right?):

its $ openssl dgst -sha512 login.com
SHA512(login.com)= 5aa178f02f8ea781ebef4f10936ef5abc3d852bbfb424b22d51c70446037f
bbda31b6cbfdc970dfa840395b7aeefe8cdfe7364582b8d0f68d0a1b667a579c7da

Steven Schweda
Honored Contributor

Re: How to create SHA512 file hash

> We are doing some data transfer (automated) and would like to have
> this hash to ensure the integrity of the data file that is being sent
> over.

   If you're not wedded to SHA512, then you might consider something
simple, like a zip archive.  The zip archive standard includes a CRC-32
checksum.  You'd get compression and a per-file CRC-32 data integrity
check with minimal extra effort.

so.nimda
Super Advisor

Re: How to create SHA512 file hash

Hi Steven,

Thanks for your reply.

I am using HPUX so need to figure out how to run OpenSSL.  Basically, the host system (HPUX) needs to automate sftp a data file over to a Windows server for processing, so need to ensure that integrity of this data file is correct.

If a hash can be successfully generated, this mean 2 files need to be sent over - the data file and the hash file. 

Is that correct?

Thanks 

 

Steven Schweda
Honored Contributor

Re: How to create SHA512 file hash

> I am using HPUX so need to figure out how to run OpenSSL.

      https://h20392.www2.hpe.com/portal/swdepot/displayProductInfo.do?productNumber=OPENSSL11I
      http://hpux.connect.org.uk/hppd/hpux/Development/Libraries/openssl-1.0.2n/

> If a hash can be successfully generated, this mean 2 files need to be
> sent over - the data file and the hash file.

   Generally, yes, but you could put both of them into a zip archive,
and send that.  (You could instead use something like "tar", but I'd
expect it to be easier to deal with a zip archive on Windows.)  Whether
you need a hash digest with a zip archive is another question.

> [...] the host system (HPUX) needs to automate sftp a data file over
> to a Windows server [...]

   You already have SFTP (SSH) on the HP-UX system?