LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Attempting to encrypt text with blowfish

Solved!
Go to solution

Hello.  Running LV2010.  I'm attempting to create a string encrypter using the blowfish vi's found on the NI website.  My ultimate goal will be to encrypt a text file to send to customers, then decrypt it in their LV application that we provide.  I wrote the EncryptProgramFile.vi and DecryptProgramFile based on the Selftest.vi example provided... or at least my understanding of it.  The problem I'm having is that the encryption doesn't seem to work right.  I don't know about the decryption as I haven't been able to get a correctly encrypted string to try.  Can anyone familiar with this please take a look and let me know if you see anything wrong?  Thanks.

0 Kudos
Message 1 of 5
(4,302 Views)

Use the Blowfish Init.vi instead of the Blowfish Encipher Decipher.vi.  With the Blowfish Init.vi you only have to pass your text and password in plus select encrypt/decrypt, it'll do everything else.

0 Kudos
Message 2 of 5
(4,292 Views)

I must be missing something.  My Blowfish Init.vi file only has one input, for the Key.  It has two outputs, producing P18 and S4x256.

0 Kudos
Message 3 of 5
(4,279 Views)
Solution
Accepted by topic author rickford66

It looks to me like your output of the while loop in Decrypt and Encrypt should be concatenating.  It's only showing you the output of the last 64 bits. 

aputman
0 Kudos
Message 4 of 5
(4,273 Views)

Oh wow, plain as can be.  I should be using a shift register because I keep replacing 8 bytes in the original output array... producing the output i'm seeing.  haha    Thanks.

0 Kudos
Message 5 of 5
(4,265 Views)