How to make Blowfish Crypto in vb 6

In a module, add the following -

Option Explicit

'Function to Decrypt the encrypted Data.
Public Function Decrypt(EncText As String, WatchWord As String) As String

'All the Dim things Follows
Dim intKey As Integer
Dim intX As Integer
Dim strChar As String
Dim DecText As String

'The Few Lines that work for us.The Following three
'Lines Create the key to Decrypt the Data.
For intX = 1 To Len(WatchWord)
    intKey = intKey + Asc(Mid(WatchWord, intX)) / 20
Next

'Here is our Engine Room that Decrypts the Data by using the key.
For intX = 1 To Len(EncText)
    strChar = Mid(EncText, intX, 1)
    DecText = DecText & Chr(Asc(strChar) Xor intKey)
Next

'Return the Data.
Decrypt = DecText

'Form1.Text3.Text = Decrypt
End Function


'Function to Encrypt the Plain Text.
Public Function Encrypt(PlainText As String, WatchWord As String) As String

'Other Dim Things
Dim intKey As Integer
Dim intX As Integer
Dim strChar As String
Dim EncText As String

'all Mighty visual Basic lines give us the Key
For intX = 1 To Len(WatchWord)
    intKey = intKey + Asc(Mid(WatchWord, intX)) / 20
Next

'the brother of decrypt function.but it earns its
'living by encrypting the data
For intX = 1 To Len(PlainText)
    strChar = Mid(PlainText, intX, 1)
    EncText = EncText & Chr(Asc(strChar) Xor intKey)
Next

'the ever so generous functios should return something.
Encrypt = EncText

'Form1.Text2.Text = Encrypt
End Function

Call it in your form -

Decrypt (Text1.Text, Text2.Text)

To use full blown Blowfish (slower system) have a look at THIS link with some code samples.

Thank's So Much

It's a pleasure.:)

Please mark this as solved, thanks.

Solved button can be found at the end of this page.;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.