ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

REST API SHA512

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 6
(2,269 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(2,212 Views)

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.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 3 of 6
(2,197 Views)

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

0 Kudos
Message 4 of 6
(2,189 Views)
Solution
Accepted by nitad54448

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

Message 5 of 6
(2,177 Views)

thanks !

0 Kudos
Message 6 of 6
(2,167 Views)