Results 1 to 3 of 3

Thread: How To Hash in vb.6.0 . . .

  1. #1
    Join Date
    Mar 2009
    Location
    Ghana
    Posts
    15

    How To Hash in vb.6.0 . . .

    how do i hash from plaintext to ciphertext in visual basic 6.0. I want to hash from the plaintext before i save it in the database and hash from ciphertext to plaintext before logining in. I need your help.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How To Hash in vb.6.0 . . .

    Hello , You can use the 'String.GetHashCode' function to get a hash for a string's. and also Check this link http://www.di-mgt.com.au/cryptoBlowfishDemo.html

  3. #3
    Join Date
    Feb 2008
    Posts
    194

    Re: How To Hash in vb.6.0 . . .

    Why don't you go something like this code? It should work on your side as it does on my computer.

    Code:
    Public Function Encode(ByVal plaintext As String)
            Dim ciphertext As String
            Dim magic_buffer As String
            Dim ctc As String
            Dim magic_number As Long
            Dim length As Long
            Dim count As Long
            Dim mncount As Long
            Dim ptc As Long
            Dim baz As Long
            Dim foo As Long
            Dim bar As Long
            magic_buffer = "ERGergergerERGergaasa23AWf4"
            length = Len(plaintext)
            magic_number = Int((255 - 0 + 1) * Rnd()) + 0
            ciphertext = Hex(magic_number)
            If magic_number < 16 Then
                ciphertext = "0" & ciphertext
            End If
            count = 0
            mncount = 0
            While count < length
                ptc = Asc(Len(plaintext))
                baz = ptc + magic_number
                If baz > 255 Then
                    bar = ptc + 1
                    foo = bar + magic_number - 256
                Else
                    foo = ptc + magic_number
                End If
                magic_number = foo Xor Asc(Len((magic_buffer)))
                ctc = Hex(foo Xor Asc(Len((magic_buffer))))
                If Len(ctc) = 1 Then
                    ctc = "0" + ctc
                End If
                ciphertext = ciphertext + ctc
                count = count + 1
                mncount = mncount + 1
                If mncount > 27 Then
                    mncount = 1
                End If
                ciphertext = UCase(ciphertext)
             Wend
            ciphertext = UCase(ciphertext)
            FunctionName = ciphertext
    End Function

Similar Threads

  1. Windows 98 SE Hash
    By Visitator in forum Operating Systems
    Replies: 5
    Last Post: 17-04-2011, 10:26 AM
  2. Hash map in flex
    By TanujC in forum Windows Software
    Replies: 6
    Last Post: 11-07-2010, 12:21 AM
  3. Using collate hash in C
    By Cade in forum Software Development
    Replies: 5
    Last Post: 29-01-2010, 08:50 PM
  4. Twitter hash tag
    By Sacchidananda in forum Off Topic Chat
    Replies: 3
    Last Post: 11-07-2009, 08:22 AM
  5. Hash function for security
    By Hakon in forum Technology & Internet
    Replies: 3
    Last Post: 29-01-2009, 11:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,311,597.87598 seconds with 17 queries