VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Encrypt & Decrypt using a key value...

by N. Pandu Ranga Rao. (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 5th September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Encrypt & Decrypt using a key value...

API Declarations


for eg.
Text2.Text = Encrypt(Text1.Text, 127) 'Encrypts Text1 contents.
Text3.Text = Encrypt(Text2.Text, 127, True) 'DeCrypts Text2 contents and places into Text3.

Rate Encrypt & Decrypt using a key value...



Dim str1, Result As String
str1 = EncryptString
For i = 1 To Len(str1)
    Select Case Decrypt
        Case False
            Result = Result & Chr(Asc(Mid(str1, i, 1)) + Key)
        Case True
            Result = Result & Chr(Asc(Mid(str1, i, 1)) - Key)
    End Select
Next
Encrypt = Result
End Function

Download this snippet    Add to My Saved Code

Encrypt & Decrypt using a key value... Comments

No comments have been posted about Encrypt & Decrypt using a key value.... Why not be the first to post a comment about Encrypt & Decrypt using a key value....

Post your comment

Subject:
Message:
0/1000 characters