|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
|
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 |
|
|
|
|
|
#2 | |
|
Member (9 bit)
Join Date: May 2007
Location: USA, New Jersey
Posts: 447
|
Quote:
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
|
|
|
|
|
|
|
#3 |
|
Member (8 bit)
|
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. |
|
|
|
|
|
#4 |
|
Professional gadfly
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
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 |