From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

database passwords and Binary files

This post is for 2 problems that I am having.
 
First is that I wanted to use a password and user name to open a table in MS Access. Set a username and password in the DB Tools Open Connection VI and then set  the same user name and password in the ODBC where it points to my .mdb file. Problem is that I can still access the .mdb file even if I remove the Password and Username from the Labview VI. mad smiley
 
Second problem is that I have created a seperate compiled LV program that allows an administrator to enter usernames and passwords (used to access the test rig only, not database) which it then saves as a binary file on the target PC which runs the main test rig LV program. I thought that this file would not be viewable as such but when I tried to open it with Notepad, no problem all text was readable. I thought that when text was saved as a binary file it became unreadable?
 
 
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 1 of 4
(2,606 Views)
All that you can do in LabVIEW or the ODBC manager is provide a password that you have defined in Access. I think Access still stores the passwords in the system database which has a .mdw extension.
 
I only had the evaluation copy of 8.2 but if I remember correctly, if you wire text to the input of write binary file, that is what the function will do. You can change the byte order or type cast the text before you do the write. If I'm wrong, hopefully someone with 8.2 will correct me.
0 Kudos
Message 2 of 4
(2,598 Views)

Hi Jack1,

      Forgive me for stepping in, but I suspect jack1 may misunderstand what "binary file" means.  If you don't want people to be able to understand the data written to a file, don't write the "plain text" to the file!

How important are the passwords you want to store?  There are some powerful encryption tools available - search "blowfish" for instance.  If you only want to make it hard for someone using a text-editor, then a quick&dirty way to "encrypt" data is by using the [boolean] XOR function.  One nice thing about XOR is that a SECOND XOR reverses the results of the first - so you can use exactly the same code to both "encrypt" and "decrypt".  An example is attached! Smiley Happy

Cheers.

Message Edited by tbd on 01-14-2007 09:11 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 3 of 4
(2,579 Views)
Thanks both, really appreciated. Setting a password in my Access table worked fine and if incorrectly set in the VI caused the connection to the table to fail. Straight on the binary file/text save now and thanks for example code. At the moment it is just simply to prevent someone casually looking at the usernames/passwords which are really of no use to anyone apart from to access the test rig.
 
Thanks again
 
John
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 4 of 4
(2,556 Views)