VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Encrypting With Keyword

Amplify  (1 Submission)   String Manipulation   Visual Basic 5.0   Unknown Difficulty   Tue 7th September 1999   Mon 8th February 2021

Encrypting With Keyword

API Declarations



Dim Current_Letter As String
Dim Encrypted_Phase1 As Long
Dim Encrypted_Phase2 As Long
Dim Encrypted_Word As String

For Letter_Count = 1 To Len(Not_Encrypted_Txt)
Current_Letter = Mid$(Not_Encrypted_Txt, Letter_Count, 1)
Encrypted_Phase1 = Asc(Current_Letter) - 1
Encrypted_Phase2 = Encrypted_Phase1 + Asc(Mid$(Key_Word, Letter_Count, 1))
Encrypted_Word = Encrypted_Word + Chr$(Encrypted_Phase2)
Next Letter_Count

Encode = Encrypted_Word

End Function

Public Function Decode(ByVal Encrypted_Txt As String, Key_Word As String)

For Letter_Count = 1 To Len(Encrypted_Txt)
Current_Letter = Mid$(Encrypted_Txt, Letter_Count, 1)
Encrypted_Phase1 = Asc(Current_Letter) - Asc(Mid$(Key_Word, Letter_Count, 1))
Encrypted_Phase2 = Encrypted_Phase1 + 1
Encrypted_Word = Encrypted_Word + Chr$(Encrypted_Phase2)
Next Letter_Count

Decode = Encrypted_Word

End Function



Rate Encrypting With Keyword (2(2 Vote))
Encrypting With Keyword.bas

Encrypting With Keyword Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters