Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-10-2008, 12:38 PM   #1
Member (8 bit)
 
Join Date: Oct 2006
Location: North Devon, England
Posts: 148
Send a message via MSN to RowanSpry
Visual Basic encoding

Another visual basic question... i know im a noob.

Iv been tampering around with the 'Advanced Login System' that SilverMagics presented on youtube, if your familiar... The major security hole though is that it of course stores the account details of the user in plain text, in a text file..

Below is the code, of course. Im looking to convert the username and password to something like Hex, or Unicode before it stores it as a text file. Can anyone help? Thanks


Private Sub CreateButton_Click()
Dim NameFile As String
Dim InputAdminpassword As String
On Error GoTo AbortSub
NameFile = Text3.Text
If Text3.Text = "" Then
MsgBox "Fill in Username"
Else
If Text4.Text = "" Then
MsgBox "Fill in a Password"
Else
If Text7.Text = "PigBath" Then
Open App.Path & "\accounts\users\" + NameFile + ".txt" For Output As #1
Print #1, Text3.Text
Print #1, Text4.Text
Close #1
End If
End If
End If
AbortSub:
Exit Sub
End Sub
RowanSpry is offline   Reply With Quote
Old 05-10-2008, 02:39 PM   #2
Member (9 bit)
 
Join Date: May 2007
Location: USA, New Jersey
Posts: 447
Quote:
Originally Posted by RowanSpry View Post

Private Sub CreateButton_Click()
Dim NameFile As String
Dim InputAdminpassword As String
On Error GoTo AbortSub
NameFile = Text3.Text
If Text3.Text = "" Then
MsgBox "Fill in Username"
Else
If Text4.Text = "" Then
MsgBox "Fill in a Password"
Else
If Text7.Text = "PigBath" Then
Open App.Path & "\accounts\users\" + NameFile + ".txt" For Output As #1
Print #1, Text3.Text
Print #1, Text4.Text
Close #1
End If
End If
End If
AbortSub:
Exit Sub
End Sub
Rowan, I think you will have a better chance at gettng help is you compose your
post with the code properly formatted. It's easy to do if you paste in your code,
select the code and click the # icon in the forum message editor. End result will
look like code window below. Note that I added blank lines and reformatted your
code to make it easier on the eye to follow. If you added comments, it would
make it even easier to follow and troubleshoot in the future.

Code:
Private Sub CreateButton_Click()

      Dim NameFile As String
      Dim InputAdminpassword As String

      On Error GoTo AbortSub
      NameFile = Text3.Text
      
      If Text3.Text = "" Then
          MsgBox "Fill in Username"
        Else
          If Text4.Text = "" Then
            MsgBox "Fill in a Password"
        Else
         If Text7.Text = "PigBath" Then
           Open App.Path & "\accounts\users\" + NameFile + ".txt" For Output As #1
           Print #1, Text3.Text
           Print #1, Text4.Text
           Close #1
       
        End If
        End If
        End If

AbortSub:
    Exit Sub

End Sub
Petef56 is offline   Reply With Quote
Old 05-13-2008, 11:58 AM   #3
Member (8 bit)
 
Join Date: Oct 2006
Location: North Devon, England
Posts: 148
Send a message via MSN to RowanSpry
Alright man thanks. I should have laid it out better..And i totally forgot about the commenting. It wont let me edit that post for some reason so here it is:

Private Sub CreateButton_Click()

Dim NameFile As String

On Error GoTo AbortSub
NameFile = Text3.Text 'TextBox3 hosts the Username string

If Text3.Text = "" Then
MsgBox "Fill in Username"
Else
If Text4.Text = "" Then
MsgBox "Fill in a Password"
Else
If Text7.Text = "PigBath" Then 'TextBox7 is the admin password input box, pigbath is the password.
Open App.Path & "\accounts\users\" + NameFile + ".txt" For Output As #1 'Creates a new text document to store the account details in
Print #1, Text3.Text 'Prints Username to a text document
Print #1, Text4.Text ' Prints password to the same text document
Close #1

End If
End If
End If

AbortSub:
Exit Sub 'On error, exit sub.

End Sub

What i needed, is to encode the username and password before it was stored in a text document.
RowanSpry is offline   Reply With Quote
Old 05-13-2008, 02:40 PM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Converting the username and password to Unicode won't accomplish anything, because Unicode is still text, it's just 16-bit text. Converting it to Hex won't really accomplish anything either if you are trying to defend yourself against people with computer knowledge.

I know that .NET has a file store that saves this kind of info encrypted. If you aren't using VB.NET, though, there really is no point in rolling your own encryption, since you still have to save the encryption key somewhere.
doctorgonzo is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Code cuzzzzzz Web Design / Development 4 02-20-2007 07:54 PM
Computer Acronyms Floppyman Computer Hardware 156 06-18-2006 06:25 AM
HOW do i make a program i written with visual basic 6 run with out visual basic 6 jaxson Web Design / Development 6 07-08-2003 09:39 AM
Visual Studio .NET install MikeeX Web Design / Development 19 09-27-2002 06:16 PM
scripts or visual basic or perl ? jchoy Web Design / Development 4 06-07-2002 08:43 AM


All times are GMT -5. The time now is 07:37 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2