• Sunday, March 2, 2014

    [VB6] Making a simple text or data encryption and decryption function.

    Making a simple text or data encryption and decryption function.

    An encryption and decryption function.
    1. Private Function Enc(eStr as string) as string
    2. Dim a As String, b As Integer, c As String
    3. c = ""
    4. For i=1 to len(eStr)
    5. a = Mid(eStr,i,1)
    6. b = Asc(a) XOR 123
    7. c = c & Chr(b)
    8. Next i
    9. Enc = c
    10. End Function

    To Encrypt the string:
    myStr = "This is a test"
    myStr = Enc(myStr)

    To Decrypt the string again use same function after encryption.

    myStr = Enc(myStr)


    Syed Masoom Rizvi

    Author & Editor

    Hi, This is Syed Masoom Rizvi, who is continue exploring the world of programming ,programming and programming... :)

    0 comments:

    Post a Comment