Results 1 to 5 of 5

Thread: Encryption VB6.

  1. #1
    Join Date
    Nov 2003

    Unanswered: Encryption VB6.


    Does anyone know where I can find some sample code for encoding a string into Base32 or another encryption system that only use ucase letters and numbers? I really need a sample project in VB6.


  2. #2
    Join Date
    Feb 2002
    Check out kong:


  3. #3
    Join Date
    Jul 2001
    My "Black Book of Tricks" has an excellent encryption/decryption program written in VB5 by Joseph Sullivan. It's short. but effective I've incorported parts of it into VB6 programs in order to encrypt and read data written to the system registers. I haven't used it to encrypt data going into databases. His e-mail address is

  4. #4
    Join Date
    Mar 2003
    Atlanta, GA

    Re: Encryption VB6.

    Here's my take on the classic Virgenere Encryption scheme that appears elsewhere on the web in Javascript..... it's done in VBScript.

    You can make the StrAlphabet into anything you want. If you will only pass uppercase characters... then only put uppercase characters in it.

    I use a strAlphabet with uppercase letters and numbers only.... for a software registration function I created.


    Function EncryptIt(strCodeword, strMessage, intAction)
       'strCodeword is the encryption key used to scramble the message.
       'strMessage is the actual message to be scrambled
       'intAction must be 0 to encrypt or 1 to decrypt the message text.
       Dim strAlphabet, intMessageChar, intCodewordChar
       Dim intShiftAdjust, intHomeLocation
       strAlphabet = "0@1#2$3%4^5&6*7=8-9+ AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
       intCodewordChar = 1
       For intMessageChar = 1 To Len(strMessage)
          If InStr(1, strAlphabet, Mid(strMessage, intMessageChar, 1), vbBinaryCompare) > 0 Then
             If InStr(1, strAlphabet, Mid(strCodeword, intCodewordChar, 1), vbBinaryCompare) > 0 Then
                intShiftAdjust = InStr(1, strAlphabet, Mid(strCodeword, intCodewordChar, 1), vbBinaryCompare)
                intHomeLocation = InStr(1, strAlphabet, Mid(strMessage, intMessageChar, 1), vbBinaryCompare)
                If intAction = 0 Then intShiftAdjust = intHomeLocation - intShiftAdjust
                If intAction = 1 Then intShiftAdjust = intHomeLocation + intShiftAdjust
                If intShiftAdjust > Len(strAlphabet) Then intShiftAdjust = intShiftAdjust - Len(strAlphabet)
                If intShiftAdjust < 1 Then intShiftAdjust = intShiftAdjust + Len(strAlphabet)
                intShiftAdjust = 1
              End If
              EncryptIt = EncryptIt & Mid(strAlphabet, intShiftAdjust, 1)
             EncryptIt = EncryptIt & Mid(strMessage, intMessageChar, 1)
          End If
          If intCodewordChar > Len(strCodeword) Then intCodewordChar = 1 Else intCodewordChar = intCodewordChar + 1
       Next intMessageChar
    End Function

  5. #5
    Join Date
    Oct 2003


    Yeah, yeah, but this is not encryption by any means; it is merely masking and why do something as cumbersome as this merely to make a string (trivially) harder to read?

    If you need encryption, do it right. Most apps don't, except to secure transmission of data (for which they routinely use SSL). If your goal is to encrypt the data and you don't do it right, then you can wind up with three equally-bad scenarios:
    • a tough steel door in a wooden wall beside an open window.
    • a sturdy door and you've locked the only set of keys inside, never to be retrieved by anyone including yourself.
    • "snake oil," where you innocently suppose that the data is secure but you're the only one who's even slightly inconvenienced. (Your enemy's not gonna tell you that "your fly is open," now is he?)
    ChimneySweep(R): fast, automatic
    table repair at a click of the

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts