Absent Member.
Absent Member.
3184 views

HMAC and SHA1 - Cobol Code/Object

[Migrated content. Thread originally posted on 20 June 2011]

I am using Dev Software Netexpress 3.1. Need to develop HMAC and SHA1 Hash encryption in Cobol.
I have had a look at the specifications and it is quite a task to develop. I was thinking if there is a Cobol object for HMAC and/or SHA1 I can use.

If not then is there a exe, dll I can call from the Cobol program, limited to Netexpress 3.1
0 Likes
7 Replies
Micro Focus Expert
Micro Focus Expert

I don't know of anything that Micro Focus provides that would help you with this.

I believe your best bet if you must stay with Net Express 3.1 is to look for a 3rd party solution such as a COM Server or security functions library that can be called.

In Visual COBOL, the .NET Framework provides classes that allow you to do this in a pretty straightforward manner.
0 Likes
Absent Member.
Absent Member.

Chris thank you so much for your reply and guidance. Unfortunately I am stuck with 3.1 thus would need to look for a 3rd Part Solution. Regards
0 Likes
Absent Member.
Absent Member.

What exactly are you trying to accomplish. Are you simply trying to encrypt a file, are you looking to hash a password for storage?

You may be able to use the FCIV tool from Microsoft to satisfy your needs. If you give me a bit more info I may be able to help you with a solution
0 Likes
Absent Member.
Absent Member.

Steve thanks for your reply. I need to accomplish the following:
1. I create a Flat ASCII "File" for a client.
2. "Key" received from client need to be HMAC hashed with IPAD.
3. This "result" is appended to a "File".
4. "File" need to "SHA1" hashed.
5. The above steps 2 - 4 is repeated with OPAD.
6. Then this entire "File" need to SHA1 hashed.
7. The first 40 "Hex characters" of the hash value is appended to the original file created.

Thanks a mil, please let me know should you reuire any further info
0 Likes
Absent Member.
Absent Member.

Hi, I am using Dev Software Netexpress 3.1. I need to use hash code in this software. There's anyone can help me ? Thanks.

0 Likes
Micro Focus Expert
Micro Focus Expert

Net Express 3.1 has been unsupported for over a decade, I believe. Help is likely to be limited.

Also, responding to a six-year-old thread is not an ideal way to ask a question. Creating a new thread in the appropriate forum is preferable.

"hash code" is extremely vague. What are your actual requirements? What kind of data are you hashing? Do you need a fast hash for keyed retrieval? A perfect (collision-free) hash for a specific data set? A cryptographic hash? A Bloom filter?

If you're looking for a cryptographic hash (which is what this original thread was about), then note there are suggestions (e.g. use a third-party library) in this thread, and other relevant suggestions in other threads on the site. Searching with a suitable keyword should find them.
0 Likes
Absent Member.
Absent Member.

I found another suggestion on the site with hexadecimal conversion.
It works for me.

We are migrating our system from Net Express 3.1 to Visual Basic .NET, by the way.

Thanks for your help.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.