Results 1 to 7 of 7

Thread: Passwords (i'm a bit dumb)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Sheffield
    Posts
    3

    Post

    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.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    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?

  3. #3
    Lively Member
    Join Date
    Jul 1999
    Posts
    99

    Post

    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.

  4. #4
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    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


  5. #5
    Guest

    Post

    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.

  6. #6
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    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

  7. #7
    Guest

    Post

    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
  •  



Click Here to Expand Forum to Full Width