Quantcast

Maximum PC

It is currently Mon Sep 22, 2014 12:57 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: TextFile Encoded Password? VB
PostPosted: Mon Aug 09, 2010 7:03 am 
Little Foot
Little Foot
User avatar

Joined: Wed Sep 17, 2008 4:09 pm
Posts: 193
I was in a conversation with my friend talking about VB, and since we're noobs we were talking about passwords and shit.

Anyway, I wanted to know how to do something like this: The program creates a text file or something with the text containing a password you set in a text box at the beggining of opening the program for the first time. On open, it will check for that file. If that file exsists, it will not load the form to make the file.

Once in the program, you are presented with the username and password. When typing it in, the program will check the file you made, and if the password you entered was correct with what was with the text file, it lets you in, and if not, it doesn't.

Also, we would like a way to change the password, such as modifying the text file via the program. Any ideas? ;)

-Mutated Gamer


Top
  Profile  
 
 Post subject: Re: TextFile Encoded Password? VB
PostPosted: Mon Aug 09, 2010 7:29 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Mutated Gamer wrote:
I was in a conversation with my friend talking about VB, and since we're noobs we were talking about passwords and shit.

Anyway, I wanted to know how to do something like this: The program creates a text file or something with the text containing a password you set in a text box at the beggining of opening the program for the first time. On open, it will check for that file. If that file exsists, it will not load the form to make the file.

Once in the program, you are presented with the username and password. When typing it in, the program will check the file you made, and if the password you entered was correct with what was with the text file, it lets you in, and if not, it doesn't.

Also, we would like a way to change the password, such as modifying the text file via the program. Any ideas? ;)

-Mutated Gamer


Yes, it can be done. Now, if you're asking us to do the work for you, you're better off trying on your own first. Post whatever code doesn't work and we'll help you from there.


Top
  Profile  
 
 Post subject: Re: TextFile Encoded Password? VB
PostPosted: Mon Aug 09, 2010 7:31 am 
Little Foot
Little Foot
User avatar

Joined: Wed Sep 17, 2008 4:09 pm
Posts: 193
DJSPIN80 wrote:
Mutated Gamer wrote:
I was in a conversation with my friend talking about VB, and since we're noobs we were talking about passwords and shit.

Anyway, I wanted to know how to do something like this: The program creates a text file or something with the text containing a password you set in a text box at the beggining of opening the program for the first time. On open, it will check for that file. If that file exsists, it will not load the form to make the file.

Once in the program, you are presented with the username and password. When typing it in, the program will check the file you made, and if the password you entered was correct with what was with the text file, it lets you in, and if not, it doesn't.

Also, we would like a way to change the password, such as modifying the text file via the program. Any ideas? ;)

-Mutated Gamer


Yes, it can be done. Now, if you're asking us to do the work for you, you're better off trying on your own first. Post whatever code doesn't work and we'll help you from there.


Okay, I'll try my best, but I'll need to look up codes on creating a text file, checking if it's there, and reading it, and checking the text (should be a if command, correct?)

Also, how would I make it create a text file nobody but the system can read/write?


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 8:33 am 
Little Foot
Little Foot
User avatar

Joined: Wed Sep 17, 2008 4:09 pm
Posts: 193
I'm stuck on this: I have form1 open when I start the program. When C:/installnotes.txt doesn't exsist, I want form1 to stay open, and when I type something into the text box and his create, it creates installnotes.txt and hides form1, and shows form2. I got that down, but this is what I'm stuck on.

When form1 loads, I want it to check for installnotes.txt, and if it exsists, hide Form1 and show form2. I use this code:
Dim check2 As New IO.FileInfo("C:/installnotes.txt")
If check2.Exists Then
Me.Hide()
Form2.Enabled = True
Form2.Show()


End If

However, if it exsists, and I start it, form2 shows up, but form1 stays open. :/


Top
  Profile  
 
 Post subject: Re: TextFile Encoded Password? VB
PostPosted: Tue Aug 10, 2010 8:00 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Mutated Gamer wrote:
Okay, I'll try my best, but I'll need to look up codes on creating a text file, checking if it's there, and reading it, and checking the text (should be a if command, correct?)

Write some pseudo-code concerning what you want to do before looking up anything VB related. Don't even worry about programming at this point.

Mutated Gamer wrote:
Also, how would I make it create a text file nobody but the system can read/write?

The problem isn't making a text file that only the system can read/write... the problem is storing an unencrypted password in a text file. This is going to be incredibly insecure. And yes, this is exactly what early Unix systems did.

program prompts user for username and password
program "hashes" password using a hash algorithm
program checks the hash in memory with the user's hash in the password file
if hashes match, the user is authenticated.
if not, the user is not authenticated.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group