10-28-2021 11:07 AM
Hi
I am trying to connect to a service through a REST API which requires identification with api keys. In the instruction manual (for Python) it is stated something like
mySign = hmac.new(bSecretKey, bSign, hashlib.sha512).hexdigest()
I have no idea how to do this hashing sha512 in Labview (pyhton is not my thing, I figure I need to output a string in Hex ?)
Thanks for any help
N
Solved! Go to Solution.
10-31-2021 01:47 AM
I don't know the answer, but the way I would approach it is to start by searching for "hmac.new", which tells you this is from a Python module for implementing the HMAC algorithm, so the next thing I would do would be to search for HMAC LabVIEW or HMAC .NET or HMAC DLL to see if there existing implementations.
If I really couldn't find anything (and that's doubtful, as at the very least, the .NET framework has a built in cryptography class with many common algorithms), then you could search for the algorithm and implement it yourself.
10-31-2021 10:41 AM
One option would be https://lvs-tools.co.uk/software/encryption-compendium-labview-library/.
Yes it's a little overkill for just the SHA algoritme, but you mentioned REST API which this library also supports in a more flexible way than the LabVIEW HTTP Client VIs.
10-31-2021 12:16 PM
Hi
Thanks for your answer. I saw that package but it's a bit pricey for what I want to do. I think I will use a DLL or a python node
Thanks
N
11-01-2021 03:42 AM
There is a great LabVIEW implementation of the .Net crypto tools available here:
https://forums.ni.com/t5/Example-Code/Cryptography/ta-p/3494085?profile.language=en
11-01-2021 07:21 AM
thanks !