Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

SHA-1 Cryptographic Hash Function

The SHA-1 encryption algorithm is often used for encrypting passwords. This is a pure LabVIEW implementation (meaning it will run on Windows, RT, and technically FPGA with a few modifications and fixing array sizes).

The algorithm is similar to the MD5 hash (which is included in LabVIEW).

This version could also serve as the basis for implementing the SHA-2 or variant algorithm in LabVIEW.

For more information on the SHA-1 see:

http://en.wikipedia.org/wiki/SHA_hash_functions

Comments
manicnobody
Member
Member
on

Is there a chance to get these VIs for Labview 8.5? Unfortunately I don't have Labview 9 and need a SHA-1 implementation for password hashing.

MarcoPolo5
Member
Member
on

Uploaded LV8.0 and later compatible VI's - happy hashing!

manicnobody
Member
Member
on

I already got a working version for LV8.5 in the forums, but nevertheless: Thank you! I bet this will help some people.

kewal
Member
Member
on

Thanks for sharing!

depa88
Member
Member
on

Hello!

I try to calculate a check sum of a full file instead of just a string.

To do so I modified the example as below:

depa88_1-1614696205048.pngdepa88_1-1614696205048.png

 

Unfortunately when I compare my result with the one provided with 7-zip i obtain a different result (If you have 7-zip installed on your PC you can gat the sha-1 has just by right click---> CRC sha---> sha1)

depa88_0-1614696074557.pngdepa88_0-1614696074557.png

 

I am not sure if 7-zip actually open the file and read the content or it has an other procedure.

Someone has an idea about how can I gat the same result?

 

depa88
Member
Member
on

I found the error by myself, here the solution to my question:

depa88_0-1617281072386.pngdepa88_0-1617281072386.png

 

rcpacini
Member
Member
on

SHA-1 VI snippet compiled in LabVIEW 2025 with no SubVI dependencies.

SHA-1.pngSHA-1.png

Tests

Test 1: ""
SHA-1: DA39 A3EE 5E6B 4B0D 3255 BFEF 9560 1890 AFD8 0709

Test 2: "abc"
SHA-1: A999 3E36 4706 816A BA3E 2571 7850 C26C 9CD0 D89D

Test 3: "hello world"
SHA-1: 2AAE 6C35 C94F CFB4 15DB E95F 408B 9CE9 1EE8 46ED

Test 4: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
SHA-1: A49B 2446 A02C 645B F419 F995 B670 9125 3A04 A259 

 

Contributors