quiero publicar en Internet como encriptar
Publicado por gerom (27 intervenciones) el 10/11/2001 17:32:10
Si me pueden ayudar a publicar esta pequeña ayuda para poder encriptar y desencriptar un campo de la base de datos
Creamos un modulo y alli ponemos lo siguiente
'autor de esta subrutina GERMAN ROMO (GEROM)
Public encripta1 As String
Public desencri1 As String
Function ENCRIPTAR(valor As String)
Dim R As Integer
encripta1 = valor
R = Len(Trim(valor))
For I = 1 To R
Mid(encripta1, I, 1) = Chr(Asc(Mid(valor, I, 1)) - 1)
Next I
End Function
Function DESENCRIPTAR(valor As String)
Dim R As Integer
desencri1 = valor
R = Len(Trim(valor))
For I = 1 To R
Mid(desencri1, I, 1) = Chr(Asc(Mid(valor, I, 1)) + 1)
Next I
End Function
En el formulario donde vamos a grabar ponemos lo siguiente
Call ENCRIPTAR(Text6.Text)
TABLA10.Fields!REMITENTE = encripta1
Y cuando queremos desencriptar la informacion es lo siguiente
Call DESENCRIPTAR(TABLA10.Fields!CARGO)
Text7.Text = desencri1
Creamos un modulo y alli ponemos lo siguiente
'autor de esta subrutina GERMAN ROMO (GEROM)
Public encripta1 As String
Public desencri1 As String
Function ENCRIPTAR(valor As String)
Dim R As Integer
encripta1 = valor
R = Len(Trim(valor))
For I = 1 To R
Mid(encripta1, I, 1) = Chr(Asc(Mid(valor, I, 1)) - 1)
Next I
End Function
Function DESENCRIPTAR(valor As String)
Dim R As Integer
desencri1 = valor
R = Len(Trim(valor))
For I = 1 To R
Mid(desencri1, I, 1) = Chr(Asc(Mid(valor, I, 1)) + 1)
Next I
End Function
En el formulario donde vamos a grabar ponemos lo siguiente
Call ENCRIPTAR(Text6.Text)
TABLA10.Fields!REMITENTE = encripta1
Y cuando queremos desencriptar la informacion es lo siguiente
Call DESENCRIPTAR(TABLA10.Fields!CARGO)
Text7.Text = desencri1
Valora esta pregunta


0