Results 1 to 5 of 5

Thread: Anyone have a very very fast encrypt/decrypt function?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269

    Anyone have a very very fast encrypt/decrypt function?

    Heres what im currently using:
    VB Code:
    1. Public Function enc(m As String) As String
    2. On Error Resume Next
    3.     Dim a As Long, x As Long, z As String
    4.     For a = 1 To Len(m)
    5.         x = Asc(Mid$(m, a, 1))
    6.         z = Chr$(x + 2)
    7.         Mid$(m, a, 1) = z
    8.     Next a
    9.     enc = m
    10. End Function
    11. Public Function dec(m As String) As String
    12. On Error Resume Next
    13.     Dim a As Long, x As Long, z As String
    14.     For a = 1 To Len(m)
    15.  
    16.         x = Asc(Mid$(m, a, 1))
    17.         z = Chr$(x - 2)
    18.         Mid$(m, a, 1) = z
    19.  
    20.     Next a
    21.  
    22.     dec = m
    23. End Function

    But im looking for something faster

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Anyone have a very very fast encrypt/decrypt function?

    There are some of these routines in our CodeBank. Have you looked at them?

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Anyone have a very very fast encrypt/decrypt function?

    Check with CVMichael...

  4. #4
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Anyone have a very very fast encrypt/decrypt function?

    This should be pretty fast:
    VB - 31 Bit Encryption function
    Also see post #18 by frozen, he changed it to process using byte arrays
    Last edited by CVMichael; Oct 22nd, 2007 at 10:04 PM.

  5. #5
    Hyperactive Member
    Join Date
    Nov 2006
    Location
    Paris
    Posts
    301

    Re: Anyone have a very very fast encrypt/decrypt function?

    Quote Originally Posted by VaxoP
    Heres what im currently using:
    But im looking for something faster
    I'm testing your code to encript/decript simple TXT files....it works fine.

    Why do you think is not fast enough ? Tell me

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