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: 

user account

I've created an exe. and ported it from my development machine to my target.  The exe calls ( needs access to) a text file.  The exe /text file work fine together on my target both logged in as ADMIN and USER ( accounts).  The problem is the user can go into windows explorer and gain access to the text file and conceivably chg it.  Is there a way to allow the Labview exe to have read privileges from the ADMIN/USER account but not the person logged into the User Desktop?

0 Kudos
Message 1 of 14
(3,220 Views)
I don't have an answer to your specific question, but I can tell you that this very scenario is why God created databases -- security.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 14
(3,205 Views)

Hey,

 

maybe a workaround for your problem:

 

Rename your file in something like: "parameters" with fileextension ".notForYourEyes" and change the data from string to Byte Array.

So no User will change something because he couldn't read it and  doesn't recognize the fileextension Smiley Happy

 

Regards,

CMW

0 Kudos
Message 3 of 14
(3,187 Views)

@CMW.. wrote:

Hey,

 

maybe a workaround for your problem:

 

Rename your file in something like: "parameters" with fileextension ".notForYourEyes" and change the data from string to Byte Array.

So no User will change something because he couldn't read it and  doesn't recognize the fileextension Smiley Happy

 

Regards,

CMW


Changing the data to a Byte Array will not help.  If I open it up in a text editor, it will still show up as normal ASCII text.

 

Now something I've been thinking about for another project I have is to invert all of the bytes that are written to the text file so that somebody with a text editor can't read it.  This would require changing to a Byte Array and then use NOT.  Write the resulting data to a binary file.  When you read it, just invert the data back and you are ready to go.


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
Message 4 of 14
(3,179 Views)

@crossrulz wrote:

Changing the data to a Byte Array will not help.  If I open it up in a text editor, it will still show up as normal ASCII text.

Now something I've been thinking about for another project I have is to invert all of the bytes that are written to the text file so that somebody with a text editor can't read it.  This would require changing to a Byte Array and then use NOT.  Write the resulting data to a binary file.  When you read it, just invert the data back and you are ready to go.


Ahh, yes you should modify your data... invert it;  would be a way to solve the readability..

 

I don't know if it would also be possible with the md5checksumfile.vi from the advanced file functions?

0 Kudos
Message 5 of 14
(3,173 Views)

I thought this would be a common question.  So its not as common to have an exe read from an external file and at the same time not allow a USER to access it??

0 Kudos
Message 6 of 14
(3,171 Views)

A Mike pointed out, if you want nobody to ever touch your file, you should be using a database.

 

I almost always want my users to have access to the files I am using.  That way they can set configuration parameters and view results.


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 7 of 14
(3,166 Views)

Could you explain the database route??

0 Kudos
Message 8 of 14
(3,160 Views)

And the good news is that every Windows machine comes with at least one database preinstalled on it. Some com[puters have multiple because some programs will install instances of things like MySQL or SQLite for their own use. For instance, if you have NI's Datalogging and Supervisory Control Module installed (or ever had it installed) you also have an instance of the free version of SQL Server running on your computer.

 

To start off, I would read this thread. It has a lot of good information in it -- as well as drivers you can use.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 14
(3,154 Views)

OK you want a data file on disk that nobody can mess with, delete or otherwise fool with for your exe.

 

Windows will allow users to access a file----It is sort of a "Core Feature" of any OS

 

So let's (re)define the actual requirement here:

You have "Data"

    • Where it is stored and how is under consideration
    • who can modify it and when is under consideration
    • what to do if unauthorized access is detected is under consideration
    • What regulatory laws must be followed?

Thats about 8 requirements that need to be documented before "The answer" can be decided on..... A text file may not be the best method.  A database may not be the best method..........it depends on a lot of other things( as I hope I made clear)


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 14
(3,147 Views)