by G?¡D¡T?? (1 Submission)
Category: Encryption
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 28th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Fast Encryption Scheme (with comment), dynamically changes (if you encrypt the same string, it changes) Supports strings up to 4404 bytes,
Dim temp As String
Dim tempA As String
Dim Rand As String
100:
Randomize
Rand = Right(Rnd, 3)
rad = Left(Rand, 1)
If Left(Rand, 1) = "-" Then
GoTo 100 'Make sure we get a len of 3 w/o negitive
End If
For i = 1 To Len(inpt)
crntASC = Asc(Mid(inpt, i, 1))
tempA = ((crntASC) Xor (Rand + i + rad)) + (i + rad)
If Len(tempA) = 4 Then
temp = temp & tempA
ElseIf Len(tempA) = 3 Then
temp = temp & "0" & tempA
ElseIf Len(tempA) = 2 Then
temp = temp & "00" & tempA
ElseIf Len(tempA) = 1 Then
temp = temp & "000" & tempA
End If
Next i
temp = Rand & temp
Encrypt = temp
End Function
Function Decrypt(ByVal inpt As String) As String
Rand = Left(inpt, 3)
For i = 4 To (Len(inpt) - 3) Step 4
z = z + 1
tempA = Mid(inpt, i, 4)
tempA = ((tempA - (z + Left(Rand, 1))) Xor (Rand + z + Left(Rand, 1)))
temp = temp & Chr(tempA)
Next i
Decrypt = temp
End Function
No comments have been posted about Fast Encryption Scheme (with comment), dynamically changes (if you encrypt the same string, it chan. Why not be the first to post a comment about Fast Encryption Scheme (with comment), dynamically changes (if you encrypt the same string, it chan.