Hi Guys,
I am providing you the code through which you can make your information/file unreadable from other users while making some kind of your personal application or database.
1. Encryption allows you to encrypt your data into unreadable form by using getting ASCII value and converting it to some number plus some KEY (your private key!) and finally using chr() function to convert it your secured file (for example: Letter "A" , get it ASCII which you know 65, then add some key/number assum 13 , which result 65+13=78, and then convert chr(78) to unreadable which "N")
2. Decryption is opposite to encryption simply subtract your key ! Cool
here are two function for vb6 beginners enjoy !
Encryption Code :
Decryption Code :Code:Public Function Encrypt(Name As String, Key As Long) As String Dim v As Long, c1 As String, z As String For v = 1 To Len(Name) c1 = Asc(Mid(Name, v, 1)) c1 = Chr(c1 + Key) ' your private goes key here ! z = z & c1 Next v Encrypt = z End Function
Look Below Attachement for Sample !Code:Public Function Decrypt(Name As String, Key As Long) As String Dim v As Long, c1 As String, z As String For v = 1 To Len(Name) c1 = Asc(Mid(Name, v, 1)) c1 = Chr(c1 - Key) 'your private goes key here ! z = z & c1 Next v Decrypt = z End Function





Reply With Quote