Crypter à la maniere de cesar

Contenu du snippet

C'est un simple décalage de lettre

text1 = msg normal
text2 = msg crypté
text3 = clef

Source / Exemple :


Dim i As Integer
Dim x, xx, xxx
Form1.Text2 = ""
For i = 1 To Len(Form1.Text1)
 x = Mid$(Form1.Text1, i, 1)
  If x = "a" Or x = "A" Then xx = 1 + Text3
  If x = "b" Or x = "B" Then xx = 2 + Text3
  If x = "c" Or x = "C" Then xx = 3 + Text3
  If x = "d" Or x = "D" Then xx = 4 + Text3
  If x = "e" Or x = "E" Then xx = 5 + Text3
  If x = "f" Or x = "F" Then xx = 6 + Text3
  If x = "g" Or x = "G" Then xx = 7 + Text3
  If x = "h" Or x = "H" Then xx = 8 + Text3
  If x = "i" Or x = "I" Then xx = 9 + Text3
  If x = "j" Or x = "J" Then xx = 10 + Text3
  If x = "k" Or x = "K" Then xx = 11 + Text3
  If x = "l" Or x = "L" Then xx = 12 + Text3
  If x = "m" Or x = "M" Then xx = 13 + Text3
  If x = "n" Or x = "N" Then xx = 14 + Text3
  If x = "o" Or x = "O" Then xx = 15 + Text3
  If x = "p" Or x = "P" Then xx = 16 + Text3
  If x = "q" Or x = "Q" Then xx = 17 + Text3
  If x = "r" Or x = "R" Then xx = 18 + Text3
  If x = "s" Or x = "S" Then xx = 19 + Text3
  If x = "t" Or x = "T" Then xx = 20 + Text3
  If x = "u" Or x = "U" Then xx = 21 + Text3
  If x = "v" Or x = "V" Then xx = 22 + Text3
  If x = "w" Or x = "W" Then xx = 23 + Text3
  If x = "x" Or x = "X" Then xx = 24 + Text3
  If x = "y" Or x = "Y" Then xx = 25 + Text3
  If x = "z" Or x = "Z" Then xx = 26 + Text3
  
  Do While xx > 26
    xx = xx - 26
  Loop
  
  If xx = 1 Then xxx = "a"
  If xx = 2 Then xxx = "b"
  If xx = 3 Then xxx = "c"
  If xx = 4 Then xxx = "d"
  If xx = 5 Then xxx = "e"
  If xx = 6 Then xxx = "f"
  If xx = 7 Then xxx = "g"
  If xx = 8 Then xxx = "h"
  If xx = 9 Then xxx = "i"
  If xx = 10 Then xxx = "j"
  If xx = 11 Then xxx = "k"
  If xx = 12 Then xxx = "l"
  If xx = 13 Then xxx = "m"
  If xx = 14 Then xxx = "n"
  If xx = 15 Then xxx = "o"
  If xx = 16 Then xxx = "p"
  If xx = 17 Then xxx = "q"
  If xx = 18 Then xxx = "r"
  If xx = 19 Then xxx = "s"
  If xx = 20 Then xxx = "t"
  If xx = 21 Then xxx = "u"
  If xx = 22 Then xxx = "v"
  If xx = 23 Then xxx = "w"
  If xx = 24 Then xxx = "x"
  If xx = 25 Then xxx = "y"
  If xx = 26 Then xxx = "z"
 Form1.Text2 = Form1.Text2 & xxx
Next i

' (c) Majen da l33t c0d4h ! huhu

Conclusion :


PS : ça ne garanti aucune sécurité

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.