1 Attachment(s)
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:
Dim cRndEnc As New clsRndCrypt
Dim EncStr As String
Dim DecStr As String
EncStr = cRndEnc.RndCryptLevel2("Hello World !", "some password", 5, 10, eBinaryString, eBase64)
Debug.Print "Encrypted String to Base64: " & EncStr
DecStr = cRndEnc.RndCryptLevel2(EncStr, "some password", 5, 10, eBase64, eBinaryString)
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.
Re: VB6 - 31 Bit Encryption - To the Next Level
CVMichael, I am a big fan of yours when it comes to encryption. Learn so much from you already buddy!
Thanks
:) :D :cool: :p :wave: :thumb: :afrog:
Re: VB6 - 31 Bit Encryption - To the Next Level
Very nice. I'm with you there Liquid Metal, CVMichael's code is the reason I know what I do about encryption.
Re: VB6 - 31 Bit Encryption - To the Next Level
Hi there.
I am completly new to the whole encryption game. Although i had read your older topic that you posted back in 2003 about your older encryption method and I read all the comments yet I am still a bit confused. I downloaded the class module encryption.
The program I am doing involves me encrypting a set of usernames that the program has randomly generated for the user - based on their input.
So lets say I just created a new project and wanted to encrypt and decrypt some data using your encryption method. What screen objects would I require: I am thinking two text boxes and two command buttons but I am unsure. Also how would I code the command buttons; i know one would be to encrypt the data, and the other to decrypt the data, but I do not know which code I should put in each button. Also I noticed the following code in your class module:
Code:
ublic Property Get DataSource() As DataSource
End Property
Public Property Set DataSource(ByVal objDataSource As DataSource)
End Property
Public Property Get DataMember() As DataMember
End Property
Public Property Let DataMember(ByVal DataMember As DataMember)
End Property
What exactly is to be inputted in these procedures?
Many thanks,
Bainy
Re: VB6 - 31 Bit Encryption - To the Next Level
I'm pretty sure I did not put those properties in there... so I have no idea how they got there. I removed them, and re-uploaded the class file.
I don't really understand your question, but you should make a thread in the General VB6 forum: http://www.vbforums.com/forumdisplay.php?f=1 where you explain better what you want, and also more people will see your question.
Re: VB6 - 31 Bit Encryption - To the Next Level
I've never used encryption and I'm having difficulty understanding how I could use it internally in a program. Let's say I to develop an app the requires a password before it can be opened. How would I go about doing that?
Re: VB6 - 31 Bit Encryption - To the Next Level