Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-03-2009
Member
 
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.
Reply With Quote
  #2  
Old 13-03-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
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
Reply With Quote
  #3  
Old 13-03-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How To Hash in vb.6.0 . . ."
Thread Thread Starter Forum Replies Last Post
Windows 98 SE Hash Visitator Operating Systems 5 17-04-2011 10:26 AM
Hash map in flex TanujC Windows Software 6 11-07-2010 12:21 AM
Using collate hash in C Cade Software Development 5 29-01-2010 08:50 PM
Twitter hash tag Sacchidananda Off Topic Chat 3 11-07-2009 08:22 AM
Hash function for security Hakon Technology & Internet 3 29-01-2009 11:09 AM


All times are GMT +5.5. The time now is 09:22 PM.