|
|
|
|
|
Dicas
|
|
Visual Basic (Miscelâneas)
|
|
|
Título da Dica: Criptogrando e descriptografando textos com no máximo 4400 bytes
|
|
|
|
Postada em 4/10/2003 por ^HEAVY-METAL^
Function Encrypt(ByVal inpt As String) As String 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
|
|
|
|
|