algoritmo criptografia
Publicado por imanol (36 intervenciones) el 24/04/2001 12:49:05
Private Sub Enkriptatu(hitza As String)
Dim luzera As String
Do While Not f_irakur.AtEndOfStream
' Lerro osoa irakurri
sarrera = f_irakur.ReadLine
l = Len(hitza)
For x = 1 To Len(sarrera)
Char = Asc(Mid$(hitza, (x Mod l) - l * ((x Mod l) = 0), 1))
Mid$(sarrera, x, 1) = Chr$(Asc(Mid$(sarrera, x, 1)) Xor Char)
Next
luzera = Len(sarrera)
If (Len(luzera)) = 1 Then
luzera = "000" & luzera
Else
If (Len(luzera)) = 2 Then
luzera = "00" & luzera
Else
If (Len(luzera)) = 3 Then
luzera = "0" & luzera
End If
End If
End If
f_idatzi.Write (luzera & sarrera)
Loop
End Sub
Tengo que poner este algoritmo en c, y no se cuales son las funciones que tengo que
utilizar en c,para hacer lo que hacen mid,chr y asc.
Dim luzera As String
Do While Not f_irakur.AtEndOfStream
' Lerro osoa irakurri
sarrera = f_irakur.ReadLine
l = Len(hitza)
For x = 1 To Len(sarrera)
Char = Asc(Mid$(hitza, (x Mod l) - l * ((x Mod l) = 0), 1))
Mid$(sarrera, x, 1) = Chr$(Asc(Mid$(sarrera, x, 1)) Xor Char)
Next
luzera = Len(sarrera)
If (Len(luzera)) = 1 Then
luzera = "000" & luzera
Else
If (Len(luzera)) = 2 Then
luzera = "00" & luzera
Else
If (Len(luzera)) = 3 Then
luzera = "0" & luzera
End If
End If
End If
f_idatzi.Write (luzera & sarrera)
Loop
End Sub
Tengo que poner este algoritmo en c, y no se cuales son las funciones que tengo que
utilizar en c,para hacer lo que hacen mid,chr y asc.
Valora esta pregunta


0