Operating System - HP-UX
1834928 Members
2946 Online
110071 Solutions
New Discussion

One way hash/encryption utility

 
Rich Kloempken
Contributor

One way hash/encryption utility

Does anyone know of a HP or other utility to create a one way hash? We do not want the ability to decript/unhash due to secirity concerns. I thought about the crypt utility, but it is 2 way.

Thanks.
Fixing bugs only reveals larger bugs that were hidden by the current bug
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: One way hash/encryption utility

Hi Rich:

You could use the crypt(3C) library function to generate a hash. It is actually a hash and not an encrytion algorithm unlike the crypt(1) command. I've attached a 1 minute c program to get you started.

Regards, Clay
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: One way hash/encryption utility

Hi again,

I've added a 30 second improvement to strip off the salt.

Use it like this:

myhash key1 key2 key3
It will print a hash of each key on a separate line.

Clay
If it ain't broke, I can fix that.