Sign in to follow this  

[vb2010] Db encryption process help?

Recommended Posts

megmut    0

Hey guys, this is my first post so sorry if this is the wrong forum but im pretty sure im in the right place. I dont usually ask in forums because someone else where has already asked it but i have searched and searched and cannot find an answer that i am looking for.

In a nutshell, i have a very basic login form which is connected to a database [access 2003] and uses IF statements to match the username and passwords. here is the code :

Imports System.Data.OleDb

Public Class LoginForm1

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source = C:\Users\Admin\Desktop\Login\database.mdb")

Dim cmd As OleDbCommand = New OleDbCommand("SELECT username,password FROM table1 where username=? and password=?", con)

cmd.Parameters.AddWithValue("username", UsernameTextBox.Text)

cmd.Parameters.AddWithValue("password", PasswordTextBox.Text)



Dim read As OleDbDataReader = cmd.ExecuteReader()

If read.HasRows Then


If UsernameTextBox.Text = read.Item("username").ToString And PasswordTextBox.Text = read.Item("password").ToString Then

Label1.Text = read.Item("password").ToString


MsgBox("Login unsuccessful, username and passwords are case sensitive")

End If


MsgBox("Login unsuccessful")

End If


Catch ex As Exception




End Try

End Sub

Now, this all works handy dandy which i was fairly chuffed at. then i thought, i might as well go all the way and encrypt it. so the plan was..

user = admin

password = 8 (inside the database) however the user chose the password 4.

when back in vb, the user enters : admin ; 4 and the program uses

"if usernametextbox.text = admin and (val(passwordtextbox.text) * 2) then

so before i go doing 128bit encryption or anything stupid.. i litrally just want to get something as simple as a multiplication password before anything more complex...

Please help me, i already have tuffs of hair missing :(

Thanks in advance and i apologise if i have not explained very well, i know what i want.. but not how to describe it :/

Share this post

Link to post
Share on other sites
Kami-    178

Assuming you're using .NET there are built in libraries for this...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.