LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build safety login system?

Solved!
Go to solution

Hello,

 

I'm building a simple user login system. like following

01. Build a database(SQLite)

02. Insert the login information( Username and password)

03. Login Interface, the vi will search the match User.

 

But i think it is too risky, because anyone can access the database via kind of tools.

Can you share the experience to us about the safety login system?

0 Kudos
Message 1 of 7
(3,015 Views)

One option is to rely on Windows (assuming that is your OS...).

 

Look at this API call:  https://msdn.microsoft.com/en-us/library/bb300969(v=vs.110).aspx

You can validate either a local or domain account.

0 Kudos
Message 2 of 7
(3,006 Views)
Solution
Accepted by topic author LabviewKK

You could encrypt the user/password database. 

 

Basic encryption is simple XOR a data stream and a repeating key, decrypt by XOR the encrypted data with the same key.

 

The longer the key the more secure the encryption.

 

enc-dec.png

Now you can store the user/passwords in a plain text file.

Read and decrypt the file into an array and do your user checking that way, no need for SQLight

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 7
(2,990 Views)

Hi 

If it is, i have a root count( user: root and password: root), someone can decrypt the key?

0 Kudos
Message 4 of 7
(2,982 Views)

@LabviewKK wrote:

Hi 

If it is, i have a root count( user: root and password: root), someone can decrypt the key?


Yes the encryption key is defined by you and would be "hard coded" into your executable so you don't have to enter it every time.  Also that means the key is not stored in clear text anywhere on the computer so even root can not just "find" the key

 

But sure someone who really knew what they were doing could probably look at the compiled code and find the key. But why would they?  

 

Having never worked with SQLight I can only guess but I think it would work if you encrypted everything as you wrote it and decrypted as you read it.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 7
(2,980 Views)
Solution
Accepted by topic author LabviewKK

I've saved the MD5 hash of a password + salt in a database.  That felt secure to me.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 7
(2,944 Views)

Can you share the Vi for reference?

Because i can not drag the picture to Labview directly.  I don't know why.

 
 
0 Kudos
Message 7 of 7
(2,927 Views)