Results 1 to 7 of 7

Thread: VB6 - 31 Bit Encryption - To the Next Level

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    VB6 - 31 Bit Encryption - To the Next Level

    This is an improved version of my VB - 31 Bit Encryption function

    I had to put the code in a Class because there is some Initializing to do.

    This version is much better than the old one. The Seed value is calculated better, it is calculated from the password (as before) but this time through more passes, and the algorithm resembles a HASH output.
    The data is encrypted better because it is using the seed value to encrypt, and not only to initialyze the random number generator as before.

    Also, you can choose the strength of the encryption by changing two values: the seed passes and data passes. Changing these values to a greater number will result into a better encryption (with the expense of time taken to encrypt)

    You can also choose to output/input the data into Hex or Base64

    Here is an example how to use it:
    vb Code:
    1. Dim cRndEnc As New clsRndCrypt
    2. Dim EncStr As String
    3. Dim DecStr As String
    4.  
    5. EncStr = cRndEnc.RndCryptLevel2("Hello World !", "some password", 5, 10, eBinaryString, eBase64)
    6.  
    7. Debug.Print "Encrypted String to Base64: " & EncStr
    8.  
    9. DecStr = cRndEnc.RndCryptLevel2(EncStr, "some password", 5, 10, eBase64, eBinaryString)
    10.  
    11. Debug.Print "Decrypted String: " & DecStr
    In the above example, I chose to have 5 passes for the seed (the password), and 10 passes through the data (to encrypt 10 times), and to output the encrypted data as Base64, and therefore the input for the decryption is also Base64.

    I also added in the Class the old encryption "RndCrypt", and also "RndCryptB" (faster version of RndCrypt improved by frozen)

    If you find any problems with the code, please let me know so I can fix them.
    Attached Files Attached Files
    Last edited by CVMichael; Dec 31st, 2010 at 06:03 PM.

Tags for this Thread

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