LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple encryption using AES algorithm- Issue

Hi,

I am using simple AES algorithm to encrypt a text file. I am simulating 3 parameters with 3 values each. SO i am running for 3 iterations to log in text file using AES algorithm. When i run only one iteration, i can decrpyt the code generated in text file easily. However, when i run more than 1 iteration, i cannot decrypt the text. 

Can someone explain me why is this happening? I spend lot of time understanding the issue. However i believe there is a small issue, but i cannot find it.

Thank you.

0 Kudos
Message 1 of 5
(3,751 Views)

I don't understand what you are doing, nor why you are doing it this way.  The VI "SimplerEncryptiton" (should that have been "SimplerEncryption"?) is missing, but I'm guessing this is encrypting a string (of what?) multiple times (and writing each to a file, not sure if they are writing multiple lines or one long string), and reporting only the last one.

 

Here is a suggestion -- create an array of three strings, "String 1", "String 2", and "String 3" and use that as input.  Maybe re-submit your VI with the missing sub-VI so we can try it ourselves and see what you are seeing.  

 

I don't have LabVIEW 2013 on this PC, so you won't be able to use this Snippet directly, but it is simple enough that you should be able to modify your own code (as I did) to reproduce this.Encryption.png

 

 

 

 

 

 

 

 

Bob Schor

 

 

0 Kudos
Message 2 of 5
(3,730 Views)

Since you are now dealing with binary data instead of text (after the encryption), you really need to right-click on the Write To Text File and turn off the "Convert End Of Line".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(3,722 Views)

Sorry, i probably forgot to add one more vi. I have attached the required files again.

I am trying to simulate the dynamic data. For example ,i have 3 parameters say RPM, Torque and speed. Each parameter is updating after every iteration( that is why i am indexing each array). I wanted to see if i can log every parameter for each iteration after the data is encrypted. However i can decrypt only the data of parameters for first iteration. If i want to go for 2 or 3 iterations, i cannot decrpyt it.

Does it make sense? 

 

Message 4 of 5
(3,693 Views)

How interesting.  Two of us made specific suggestions, you followed neither of them, but did attach the missing VI.  OK, now go back and read (and think about, and be sure you understand) the earlier suggestions.

 

Do you understand the difference between an array of U8's and a String, especially when it comes to I/O?  Some of us are old enough to remember when NUL (0x00) was simply not written, and ^Z (0x1A, I think) would end the file.  And here you are inserting additional characters into an encrypted string and wondering why you can't decrypt it!

 

Go back, read our suggestions, do the "simple experiments" we outlined, and figure out how to do this correctly yourself.

 

Bob Schor

0 Kudos
Message 5 of 5
(3,676 Views)