Tema: Encriptación {WINDOWS FORM}
Pregunta: ¿Comó Encripto un String?
Respuesta: Puedes usar estas funciones que cree de encriptación muy efectivas y cortas aqui les dejo el codigo:
Función complementaria
Código vb:
Ver originalFunction Invert(ByVal value As String) As String
Dim i As Integer, _
value2 As String = value
value = Nothing
For i = value2.Length To 1 Step -1
value = value & Mid(value2, i, 1)
Next
value2 = Nothing
Return value
End Function
Encriptación ASCII
Código vb:
Ver originalFunction EncriptEx(ByVal text As String) As String
EncriptEx = New String(Nothing)
Dim Null As String = Nothing
For Each i As String In text
Select Case Asc(i)
Case 10 To 99
Null = "0"
Case 100 To 255
Null = Nothing
End Select
EncriptEx = EncriptEx & Null & Asc(i)
Next
Return Invert(EncriptEx)
End Function
Function DencriptEx(ByVal text As String) As String
DencriptEx = New String(Nothing)
text = Invert(text)
For i As Long = 1 To Len(text) Step 3
DencriptEx = DencriptEx & Chr(Mid(text, i, 3))
Next
Return DencriptEx
End Function
Encriptación ASCII con HEXADECIMAL
Código vb:
Ver originalFunction Encript(ByVal text As String) As String
Encript = Nothing
For Each i As String In text
Encript = Encript & Hex(CInt(Asc(i) & "0"))
Next
Return Invert(Encript)
End Function
Function Dencript(ByVal text As String) As String
Dim ik As Long
text = Invert(text)
Dencript = Nothing
For i As Integer = 1 To text.Length Step 3
ik = CInt("&H" & Mid(text, i, 3))
If ik > 255 Then
ik = ik / 10
End If
Dencript = Dencript & Chr(ik)
Next
Return Dencript
End Function
Espero que les haya sido de utilidad...