|
-
Jan 23rd, 2000, 05:24 AM
#1
Thread Starter
New Member
This is a really straightforward problem, but basically i need a password screen with password, and the option to change the password (obviously you will have to ask for the current password). Piss i know, but im a bit of a newbie.
-
Jan 23rd, 2000, 09:01 AM
#2
Just put a TextBox on a form and set the TextBox's Password property to "*". Then code MyForm.Show vbModal. If what the user then types into the TextBox matches the password, unload MyForm, otherwise display an error message.
------------------
Marty
Can you buy an entire chess set in a pawn shop?
-
Jan 23rd, 2000, 11:03 AM
#3
Lively Member
you could also create an encrypted file to store the passwords there and change it's contents when ever an authorized user wants to change password.
-
Jan 23rd, 2000, 05:21 PM
#4
Hyperactive Member
I too, have heared of this crypting technology for storing the passwords..Can any of you please tell me the way how to encrypt the files and validate if there is a correct password given by the user??
------------------
Regards,
Venkat
[email protected]
ICQ: 45714766
http://venkat.iscool.net
-
Jan 23rd, 2000, 11:58 PM
#5
Venkat,
The most common way of encrypting in VB is to convert the value to ascii and store it numerically. This is also very common and always looked for by those who try to crack passwords and hack programs.
To increase the strength of your encryption you can run the subsequent ascii values through a one way mathmatical equation. Then when the user types in his/her password also change the new value to ascii and run it through the same equation and check to see if the value match. If they match then the password is valid.
------------------
Boothman
There is a war out there and it is about who controls the information, it's all about the information.
-
Jan 24th, 2000, 01:41 AM
#6
So Unbanned
here's a way of encrypting if you don't get how...
If you have VB6 ignore this part:
Code:
Public Function Replace(Msg As String, A As String, B As String)
Dim I As Integer
I = InStr(Msg$, A$)
While I <> 0
Msg$ = Left$(Msg$, I - 1) & B$ & Mid$(Msg$, I + Len(A$))
I = InStr(I + Len(A$), Msg$, A$)
Wend
Replace = Msg$
End Function
VB6 includes this command anyway the rest of the code:
Code:
Public Function Crypt(TxtBox1 As TextBox)
Dim ASCode As String
Dim ASCodVar As String
For x = 1 To Len(TxtBox1)
ASCodVar = Asc(Mid$(TxtBox1, x, 1))
If Len(ASCodVar) < 3 Then
Do
ASCodVar = "0" & ASCodVar
Loop Until Len(ASCodVar) = 3
End If
ASCode = ASCode & ASCodVar
Next x
Crypt = ASCode
End Function
Public Function DeCrypt(TxtBox1 As String)
Dim myChar As String
Dim DCrypt As String
For x = 1 To Len(TxtBox1) Step 3
myChar = Chr$(Mid$(TxtBox1, x, 3))
DCrypt = DCrypt & myChar
Next x
DeCrypt = DCrypt
End Function
Private Sub Command1_Click()
code$ = Crypt(Text1)
code$ = Replace(code$, "0", "*")
code$ = Replace(code$, "1", "$")
code$ = Replace(code$, "2", "^")
code$ = Replace(code$, "3", "~")
code$ = Replace(code$, "4", "@")
code$ = Replace(code$, "5", "`")
code$ = Replace(code$, "6", "?")
code$ = Replace(code$, "7", "|")
code$ = Replace(code$, "8", "!")
code$ = Replace(code$, "9", "%")
Text2.Text = code$
End Sub
Private Sub Command2_Click()
code$ = Text2.Text
code$ = Replace(code$, "*", "0")
code$ = Replace(code$, "$", "1")
code$ = Replace(code$, "^", "2")
code$ = Replace(code$, "~", "3")
code$ = Replace(code$, "@", "4")
code$ = Replace(code$, "`", "5")
code$ = Replace(code$, "?", "6")
code$ = Replace(code$, "|", "7")
code$ = Replace(code$, "!", "8")
code$ = Replace(code$, "%", "9")
Text3.Text = DeCrypt(code$)
End Sub
what this does:
converts the characters into the ASCii reference then changes the numbers into characters then back upon request
pretty simple
Good Luck
------------------
DiGiTaIErRoR
-
Jan 24th, 2000, 03:25 AM
#7
all modern encryption techniques use the XOR mathematical operator, look it up on the MSDN website
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|