LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Encode of password

Solved!
Go to solution

Hi,

I am currently developing a small program that I record the user's password in a text file. I want a method to encode the string password and the decoding method when reading and verification. Is there an algorithm or function already made ​​for this purpose.

Best Regards

0 Kudos
Message 1 of 6
(3,665 Views)

Hi,

 

there is an instrument driver available providing functions for creating and manipulating passwords, may be it's usefule for your purpose... It's located in toolslib\custctrl\pwctrl

0 Kudos
Message 2 of 6
(3,659 Views)

I wrote a small example to accomplish the task of storing password: you can find it here. It includes a brief explanation of a possible strategy to use to store user passwords in a safe way.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 6
(3,653 Views)

Thank you for your answers. 

It is a very thorough method for encoding passwords.Is that it is a simple method to encode a password just so that the password isincomprehensible to the reader of the record file. I am not very interested in the complexity of coding and the level of security. I just want that when someone opens the log file can not know directly what is the password.

Exemple: password---->A26Gh12.

Do you prefer to save the password in a file that will be housed in the installation folder or there is another method.

 

 

Best Regards

0 Kudos
Message 4 of 6
(3,643 Views)
Solution
Accepted by topic author fishingman

When coming to password we need to discuss the goal you are aiming to. I suppose none of us is developing any e-commerce application Smiley Wink, so probably what we do need is only a way to delimit the use of part of all the application to users trained to it. I.e. the password is used only to avoid that non-experienced users can use problematic functions / applications and damage some equipment and / or some DUT.

 

In this respect, it's probably correct to limitate the security to some level of masking, so that passwords cannot be recognized at a glance. In this respect simply encoding character in octal and storing the resulting string can be enough. I choose octal as probably users are accustomed to hexadecimal at least to recognize it and start thinking on how to decode things; octal is a bit less frequent.

A simple octal encoding gives from "Password" the string "120141163163167157162144" which may give an enough level of difficulty to decode. This may be obtained from this line of code (see the online help for Fmt function to understand the formatting string):

 

char   msg[512], pw[64];

Fmt (msg, "%*i[zb1w3p0r8]", strlen (pw), pw);

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 6
(3,638 Views)

Hi,

Thank you for your help. I accept this solution.

Manay Thanks

0 Kudos
Message 6 of 6
(3,612 Views)