Results 1 to 4 of 4

Thread: Encryption

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Hi

    Does anyone know of a real beefy encryption function that I can use to store gibberish in the registry, but can be read by my program. I've got one that replaces one character with another, but that seems shockingly easy to figure out (look at enough examples and what has been replaced by what is easy to work out!)

    Thanks in advance,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Ireland
    Posts
    96

    Post

    Use an XOr function, like the following, unless you know the lngKey value you won't deciper it. You could make it more cryptic if you use groups of characters and a bigger lngKey value.

    Private Function Crypt(MyString as String) as String
    Dim n As Long, lngKey As Long, tmpString As String
    lngKey = 255
    For n = 1 To Len(strInput)
    tmpString = tmpString + Chr(lngKey Xor Asc(Mid(MyString, n, 1)))
    Next n
    Crypt = tmpString
    End Sub

    Usage:
    EncryptedString = Crypt(NormalString)
    NormalString = Crypt(EncryptedString)

    Just an idea,
    Steve.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Thanks steve, i'll give it a shot later.

    cheers

    regards,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Steve - it just returns nothing, I don't know if it's a zero=length string, null or what, but Msgbox shows up as nothing and so does putting encrypted string in a textbox

    I used...

    Text2.Text = Crypt(Text1.Text)

    Any ideas?

    Thanks for your time

    Kind regards,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it

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