Public Function Decrypt(ByVal clave As String) As String
' Defino variables
Dim indice As Integer = 1
Dim largo As Integer = 0
Dim final As String = ""

' Calculo el largo de la cadena
...