Results 1 to 11 of 11

Thread: VB6 Encryption & Decryption Try it ! (Make itSimple)

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2010
    Posts
    6

    VB6 Encryption & Decryption Try it ! (Make itSimple)

    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 :
    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
    Decryption Code :
    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
    Look Below Attachement for Sample !
    Attached Files Attached Files
    Last edited by ahsan_ali; Jul 9th, 2010 at 01:01 AM.

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