Jump to content

SHA256 Hash Algorithm

Recommended Posts

Greetings, all!

This is pretty self-explanatory. I need a LabVIEW implementation of the SHA256 hash algorithm. I could do it myself, but I was hoping one already exists. Has anyone written such a beast?


Share this post

Link to post
Share on other sites

I've never made anything like this in LabVIEW but there are several commonly used DLLs which give you this function.

Searching Hashes.dll in google came up with several places to get a DLL that calculates a whole bunch of hashes.






















I don't have any VI that uses this DLL but I don't think it should be too hard to get the functionality you want.

Share this post

Link to post
Share on other sites

On on a mac at the moment so can't check but I'm sure there must be a SHA256 call in the .NET stuff (probably in system.security.cryptography)

  • Like 1

Share this post

Link to post
Share on other sites

I tried it through .net and it works.

Awesome, thanks!

Share this post

Link to post
Share on other sites
On 7/15/2010 at 7:31 PM, MikaelH said:

I tried it through .net and it works.

post-941-005122700 1279247370_thumb.png

I had to browse for the mscorlib.dll file for LabVIEW to find the SHA256Managed-class.



Hey @MikaelH. I can't seem to be able to create this on my system. Can you post a VI or a snippet of the above code? Thanks and wishing you well.

Share this post

Link to post
Share on other sites

There is no need to go through external code for this. There have been many attempts at crypto libraries that are written natively in LabVIEW and they didn't fail because it is impossible but because nobody is interested to spend some time in searching for them or what a bad word, fork a few dollars over for them. That way authors have put out libraries in the past only to have them forgotten by the public and that is the most sure way for any maintenance work and improvement to be discouraged.

Probably the first one was Enrico Vargas who wrote a pretty versatile Crypto library all in LabVIEW somewhere around 2000. It contained many hash and even symmetric algorithmes that were pretty well tested and he was an expert in that subject. And yes he charged something for that library which I found reasonable, I bought a license too and collaborated with him a little on some algorithmes and testing of them. I doubt he made much money with it though, as most Toolkit providers. Eventually it died of because he pursuaded other carrier options and maybe also partly because providing support for something that many were asking for but very few were willing to pay for is a frustrating exercise.

A little googling delivers following solutions currently available:

https://github.com/gb119/LabVIEW-Bits/tree/master/Cryptographic Services/SHA256



Interesting disclaimer in the last link! 😀

I would say whoever understands the implications of this, is already aware of the limits in using such functions, but whoever isn't won't be bothered by it. There are several aspects to this, such that calling the same function in .Net or WinAPI (also a possibility) is not necessarily more safe as the actual string is still possibly somewhere in LabVIEW memory after the function is called, no matter how diligent the external library is about clearing any buffer it uses.

Also many hashes are mostly used for hashing known sources. which does not have the problem that the original string or byte stream needs to stay secret at all as it is already in memory anyways elsewhere. So for such applications the use of these functions in LabVIEW would not cause any extra concerns about lingering memory buffers that might contain "the secret" after the function has finished.

Edited by Rolf Kalbermatter
  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.