Bonsoir, voilà parès avoir galerer sur le challenge de SPH. Je mis met aussi !
Donc la chaine est une phrase, la clé contient uniquement des lettres et fait entre 0-8 de longueur.
Franchement bravo à celui qui va trouver ! Et je ne suis pas vache je donne le code de cryptage fait à l'arrache certe ^^
Code : Tout sélectionner
; /////////////////////////Cryptage Xor///////////////////////
; ////////////////////////Le psychopathe//////////////////////
; ///////////////////////////07/07/2010///////////////////////
Global txt$=""
Global cle$=" "
Procedure cryptage_Xor(valeur_chaine, valeur_clef) ; converti valeur en binaire pour xor
For i=1 To 8
resultat = Val(Mid(RSet(Bin(valeur_chaine,#PB_Ascii), 8, "0"),i,1)) XOr Val(Mid(RSet(Bin(valeur_clef,#PB_Ascii), 8, "0"),i,1))
sortie$ = sortie$ + Str(resultat)
;Debug sortie$
Next
ProcedureReturn Val(sortie$)
EndProcedure
Procedure bin_to_ascii(binaire)
ProcedureReturn Val("%"+ RSet(Str(binaire),8,"0"))
EndProcedure
Procedure sendcrypt(chaine$, cle$)
pointeur=1
a$="Data.b "
For i=1 To Len(txt$)
b.b = bin_to_ascii(cryptage_xor(Asc(Mid(txt$,i,1)),Asc(Mid(cle$,pointeur,1))))
;Debug b
a$+Str(b)
If Len(a$)> 150
Debug a$
a$="Data.b "
Else
a$+","
EndIf
pointeur+1
If pointeur>Len(cle$)
pointeur=1
EndIf
Next
Debug a$
EndProcedure
sendcrypt(txt$,cle$)
Data.b 12,22,27,73,75,23,42,0,1,69,10,17,53,7,23,11,15,19,32,15,82,-123,75,21,55,28,23,23,75,4,35,19,27,6,10,2,32,24,23,11,31,65,51,26,1,69,31,0,39,25,23
Data.b 4,30,25,107,85,55,3,13,4,38,1,27,19,14,12,32,27,6,73,75,8,41,85,1,0,75,17,32,0,6,69,26,20,32,85,4,10,30,18,101,20,11,0,17,65,33,16,1,69,31,0,39,25
Data.b 23,4,30,25,101,22,29,11,31,4,43,20,28,17,75,5,32,6,82,1,4,15,43,-100,23,22,75,73,43,26,31,7,25,4,54,89,82,6,3,0,44,27,23,22,75,5,32,85,17,4,25,0
Data.b 38,1,-102,23,14,18,105,91,92,75,66,65,32,1,82,20,30,4,101,3,29,16,24,65,33,-100,1,12,25,8,32,15,82,17,25,8,32,7,82,21,10,19,101,26,0,1,25,4,101,22
Data.b 0,10,2,18,54,20,28,17,68,5,-84,22,0,10,2,18,54,20,28,17,75,2,32,85,6,4,9,13,32,20,7,75,75,37,36,27,1,69,8,4,101,22,19,22,71,65,44,25,82,0,24,21,101
Data.b 5,0,-116,13,-120,55,20,16,9,14,65,33,82,7,17,2,13,44,6,23,23,75,20,43,85,22,0,24,65,36,25,21,10,25,8,49,29,31,0,24,65,33,16,82,17,25,8,101,17,23
Data.b 69,8,4,49,1,23,69,24,4,38,1,27,10,5,79,