Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 15th, 2005, 12:42 PM   #1
ragenuub
Newbie
 
Join Date: Oct 2005
Posts: 9
Rep Power: 0 ragenuub is on a distinguished road
password box

well im following this guide and this code does not seem to work it keeps giving me error, the guide is telling me to make a password box. some error at the first line..

im following this tutorial http://cuinl.tripod.com/tutorials/f-45.htm

Private Sub Form_Load()     
Dim password As String
password = InputBox("Please enter the password")
If (password = "let me in") Or (password = "sam sent me") Then
MsgBox "The password is correct!"
Else
MsgBox "incorrect password!"
End
End If

Last edited by ragenuub; Nov 15th, 2005 at 1:00 PM.
ragenuub is offline   Reply With Quote
Old Nov 15th, 2005, 12:57 PM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by ragenuub
well im following this guide and this code does not seem to work it keeps giving me error, the guide is telling me to make a password box. some error at the first line..

im following this tutorial http://cuinl.tripod.com/tutorials/f-45.htm

  
Dim password As Integer
...
If (password = "let me in") Or (password = "sam sent me") Then
First off password won't ever end up equaling a string value since it's being dimed as an integer (unless VB does some weird type change I'm not familiar with.)

note:The tutorial code even Dims password as a string

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old Nov 15th, 2005, 1:04 PM   #3
ragenuub
Newbie
 
Join Date: Oct 2005
Posts: 9
Rep Power: 0 ragenuub is on a distinguished road
ahh typo, fixed that but it still does the same thing O.o

it says

"Compile error
expected End Sub"

then marks

Quote:
Private Sub Form_Load()
with yellow
ragenuub is offline   Reply With Quote
Old Nov 15th, 2005, 1:31 PM   #4
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Bear in mind that if this is actually going in for real life use, and is protecting sensitive information, it could be trivially defeated.

If you actually designing this for a public system or something and want this to be secure in any way or robust enough for public exposure, you firstly need to authenticate by comparing hashes rather than values directly (you are opening yourself to memory inspection and disassembly attacks).

Also protect the variable address using the RTL Api (VarPtr) and call SecureZeroMemoryW on it when you are finished (under Windows), as the garbage collection in VB6 is notoriously bad and sometimes doesn't happen. Consult the NTLM reference on MSDN, as it has good documentation on general memory sanitization in VB6.

Alternatively use a language that deals with memory properly, or use an purpose built external authentication system.
Rory is offline   Reply With Quote
Old Nov 15th, 2005, 2:47 PM   #5
ragenuub
Newbie
 
Join Date: Oct 2005
Posts: 9
Rep Power: 0 ragenuub is on a distinguished road
Quote:
Originally Posted by Rory
Bear in mind that if this is actually going in for real life use, and is protecting sensitive information, it could be trivially defeated.

If you actually designing this for a public system or something and want this to be secure in any way or robust enough for public exposure, you firstly need to authenticate by comparing hashes rather than values directly (you are opening yourself to memory inspection and disassembly attacks).

Also protect the variable address using the RTL Api (VarPtr) and call SecureZeroMemoryW on it when you are finished (under Windows), as the garbage collection in VB6 is notoriously bad and sometimes doesn't happen. Consult the NTLM reference on MSDN, as it has good documentation on general memory sanitization in VB6.

Alternatively use a language that deals with memory properly, or use an purpose built external authentication system.

umm im quit newb i didnt get much of that information O.o, but ill look into it for the future. It's not for any real life use just for fun, thanks tho. so anyone know why it says that error? is the tutorial missing something?

::edit::

figured it out

   End
End If
End Sub

had to add that to the end

Last edited by ragenuub; Nov 15th, 2005 at 3:00 PM.
ragenuub is offline   Reply With Quote
Old Nov 15th, 2005, 3:46 PM   #6
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 3 ivan is on a distinguished road
Hard questions around here...
ivan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:42 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC