Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Command1_Click() Dim i As Integer Dim Source As String, Buffer As String, Password As String Source = InputBox("Tapez votre message à crypter", "", "") Password = InputBox("Tapez votre mot de passe", "", "") For i = 1 To Len(crypte) Buffer = Buffer & Chr$(Asc(Mid$(Source, i, 1)) Xor GetXor(Password)) Next i Text1.Text = Buffer End Sub Private Sub Command2_Click() crypte = InputBox("tappez votre message a décrypter", "crypte", "message") longueur = Len(crypte) For i = 1 To longueur x= Asc(Mid(crypte, i, 1)) valeur = Chr$(x Xor GetXor(Password)) yo = yo & valeur Next i Text1.Text = yo End Sub Public Function GetXor(Password As String) As Double Dim i As Integer Dim Ret As Long, Tmp As Long For i = 1 To Len(Password) Tmp = Asc(Mid$(Password, i, 1)) GetXor = GetXor + Tmp * 2 ^ i Next i End Function
For i = 1 To longueur var= Mid(crypte, i, 1) valeur = Asc(var) Xor 1 yo = yo & Chr$(valeur) Next i Text1.Text = yo
For i = 1 To longueur var = Asc(Mid(crypte, i, 1)) valeur = Chr$(var Xor 1) yo = yo & valeur Next i Text1.Text = yo