VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Encrypt/Decrypt Text with Ease

by VisualBlind (12 Submissions)
Category: Encryption
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

This is an awesome encryption algorithm that you can you really use to encrypt and decrypt text. It works on multiline textboxes and singleline as well...Have PHUN!

Rate Encrypt/Decrypt Text with Ease

'.......................................................
'to encrypt:
'right before you save you go:
'password = Encrypt(password) password is the variable
'.......................................................
Public Function Encrypt(ByVal Plain As String)
  Dim Letter As String
  For i = 1 To Len(Plain)
    Letter = Mid$(Plain, i, 1)
    Mid$(Plain, i, 1) = Chr(Asc(Letter) + 111)
  Next i
  Encrypt = Plain
End Function
'password = Encrypt(Text1)
'Text2 = password

'...................................................
'to decrypt:
'right before you load the password you go:
'password = Decrypt(password)
'....................................................
Public Function Decrypt(ByVal Encrypted As String)
Dim Letter As String
  For i = 1 To Len(Encrypted)
    Letter = Mid$(Encrypted, i, 1)
    Mid$(Encrypted, i, 1) = Chr(Asc(Letter) - 111)
  Next i
  Decrypt = Encrypted
End Function

Download this snippet    Add to My Saved Code

Encrypt/Decrypt Text with Ease Comments

No comments have been posted about Encrypt/Decrypt Text with Ease. Why not be the first to post a comment about Encrypt/Decrypt Text with Ease.

Post your comment

Subject:
Message:
0/1000 characters