LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save alphanumeric text to file that can't be read in Notepad.

Solved!
Go to solution
I currently have an application that includes a higher level of access to special users.  In order to prevent the login from being "hacked", the password is hard-coded in the executable.  I'd like to make this dynamic so that my users can change the password at will, but don't want anyone to be able to just open the password file in Notepad or equivalent.  Is there a way to convert and save the alphanumeric text in such a format that a simple text reader could not decipher it?
0 Kudos
Message 1 of 7
(4,284 Views)

You should store the MD5 has of the password.

In the code you let the user enter the password, calculate the hash and see if they match.

 

LabVIEW has build in VIs to get the hash of a string.

 

It is quite hard to decode a password with unkknown length from it's hash.

Additional I would still hard-code a core password only known by you that you can type in yourself. After which you can generate a new password file.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 7
(4,278 Views)

Since I am unfamiliar with the term "MD5 hash", I did a function search in LabVIEW.  The only function I came up with was "MD5Checksum File.vi", but I can't think how it applies.  Can you be more specific on how one "calculates the hash"?

0 Kudos
Message 3 of 7
(4,273 Views)

I am sorry I thought the native MD5 function supported strings.

The OpenG toolkit has a function MD5 Message digest that support strings:

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 4 of 7
(4,266 Views)
Solution
Accepted by topic author AEI_JR

Use encryption. There is a free application in the fourms for Blow Fish. It is very simple and everything is encrypted.

 

http://zone.ni.com/devzone/cda/epd/p/id/3473

 

It is very easy to use.

Tim
GHSP
Message 5 of 7
(4,257 Views)
Thanks to you both.  I decided to go the encryption route - it worked exactly as I need.
0 Kudos
Message 6 of 7
(4,249 Views)

Hi,

here's something very simple to use to to stop people just opening up the file and reading it. Change the string to a byte integer and alter the values by a known constant, then when reading the byte, alter the values back and convert to a string . Its obviously not much of an encryption but if anyone opens the file they can't read the password.

 

 

 

write password.pngRead Password.png

Message 7 of 7
(4,246 Views)