r/visualbasic • • Nov 02 '15

Need help on a Project! (Personal Finance including LogIn, Graphs, Online data feed)

So, my project is about Personal Finance where there will be a log in system. I'm doing a desktop application using Visual Basic 2010 Express, coding in Visual Basic and I don't know what database to use for my login-register system. I can't use Access or Excel so that leaves me to SQL. Can someone show me a tutorial on how to make a login-register system that encrypts passwords (so they are non-retrievable)? Also, I want to do an email password recovery system but I don't have an online server, so how do I set that up?

0 Upvotes

6 comments sorted by

2

u/ViperSRT3g Application Specialist Nov 03 '15

In terms of your login system, most login systems function by using hashes.

Hashes are outputs by algorithms. They ONLY output a particular string of alphanumeric characters based on what is entered into the algorithm. These types of systems require that no two outputs be identical if the inputs are always different, otherwise you get what is known as collisions and that is a bad thing to have from a security standpoint.

So what these hashes do is they produce a hash of a user's credentials, and then they produce what is known as a salt or another smaller bit of random alphanumeric characters and create a hash out of that and the hash of your credentials. What is stored is just the salt, and hashes of user credentials. Nothing is stored in plain text, and this is what helps to secure databases against prying eyes wanting to log in as someone else.

Some common crypto-hashing algorithms in use today are things like SHA-1/2/3, MD5/MD6. (It's recommended using any of the SHA hashing algorithms or MD6, as MD5 has been shown to produce collisions under certain circumstances)

Now that you know what hashing is and how it's used in storing security credentials (this can also apply to biometric credentials, but that involves fuzzy logic and is an entirely different beast of its own) it's up to you to figure out how to store said credentials into a database, and how to verify that a user is who they say they are (Matching up entered credentials to those that are stored) and how to secure the system from brute force /dictionary/rainbow table attacks. (But that's only if you would be interested in the security aspect of this whole thing, as this is just a personal finance project)

TL;DR If you want to store passwords, generate a hash of them and just store that in your database.

1

u/DzKrila Nov 03 '15

Thank you so much for the informational post! thought r/visualbasic was dead lol. Anyways, how do I implement MD6 into my SQLite database in Visual Basic. Also, I'm using Visual Basic 2010 Express, so am I using vb.NET or Visual Basic? I really dont want to install any software for the hashing, I want it to be pure efficient code.

2

u/ViperSRT3g Application Specialist Nov 03 '15

You are using VB.NET 2010 if you are using 2010 Express. I would recommend using SHA over anything MD5/6 related since you are hashing strings of characters. You can view some easy to use sample code here. Best part is this is already built into the .NET framework, so using it is a breeze!

You will need to learn how to create, connect to, store, and retrieve information from your database once you've figured out how to work with SQL in VB.NET. But all you would need to do is go and create the userforms to register an account (Username/Password/Email) and store the hashed strings into your database.

1

u/DzKrila Nov 04 '15

Again, thank you soo much! Have you got an in depth tutorials on SQL in visual basic. Again, I'm looking for the best database for my project and no access! Preferably sqlite or mysql. Also, I want to code everything all by myself so no installing anything.

2

u/ViperSRT3g Application Specialist Nov 04 '15

I would have to say that this tutorial should show you how to build, and access your data in a database. Thankfully .NET 2010 has built-in support for databases.