LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a password (string) in a binary file ?

Hi everyones,

I would like to know if it's possible to save a string in a binary file.

Goal: In fact, I would like to create a password access modifiable by the user. The user will click on the first panel and will be redirected to an password panel. If his password is the same that the string saved in a extern binary file, he will be then redirected to an final panel.
Finally, on the final panel, it will have the right to change the old password by a new one.

Thanks for your help 🙂

Seb.
0 Kudos
Message 1 of 7
(6,651 Views)
The real issue here is how to save the password securely so someone can't open the password file with a text editor and see what the password is.The question is how paranoid do you want to be? A simple ROT N operation provides basic security, but is't very hard to break if someone really wants to hack into it and knows something about computers.How determined a hacker are you trying to keep out?Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 2 of 7
(6,651 Views)
Hi Mike and Thks. I do not need an extreme security for my program. Could you explain me how to use the "simple ROT N operation" ?
Thks.
Seb
0 Kudos
Message 3 of 7
(6,651 Views)
The idea is really simple. All you do is convert the string of characters to an array of numbers and add a constant value N to each element. Then if the resulting character value is either greater than 256 (the maximum ASCII value) or less than zero you modify the value to bring it back into range. Finally you convert the modified array of numbers back into a string and you're done.

To unscramble your string run it through the VI again using the negated value of the number you used originally. For example, of you did your original scrambling by using 24, unscramble using -24.

Attached is a VI I created for performing this function.

Mike...

PS: Any number between 0 and 255 will work. And don't use 13. That would be the first on
e everyone would try. Also, security will be marginally better if the password is a random series of letters and not a real word.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 4 of 7
(6,651 Views)
Sorry Mike,

I couldn't resist to the urge to simplify your VI...


LabVIEW, C'est LabVIEW

0 Kudos
Message 5 of 7
(6,651 Views)
Thanks for providing the incentive to look over a very old VI. However, while the code you posted works fine for scrambling, to unscramble you had to do a little math to come-up with the proper numeric value to use. With the original scrambling would use (for example) 45, and descrambling would use -45.

To get one that behaves the same as the original requires a little more work...

🙂

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 6 of 7
(6,651 Views)
To decrypt the string in Drolet's VI it is just a matter of substracting the key to the encrypted string.

About the original issue, it is good to be aware in avoiding to be "paranoid" about the security your application needs.

To avoid the paranoia and put in place mechanisms that effectively meets your security objectives, be sure you consider not only the "hacker", but also applicable organizational security policies of the site and other safeguards. That should give you an adequate picture to determine your security needs and if a simple Caesar encryption, which was the option provided here by the fellow wireworkers, satisfy those needs.

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 7 of 7
(6,651 Views)