Accueil > > > CRYPTOGRAPHIE AFFINE
CRYPTOGRAPHIE AFFINE
Information sur la source
Description
Petite application destinée principalement aux Terminales S spécialité Maths (avec toutefois prolongement vers l'algèbre du supérieur) ; explications sur le cryptage et sur la façon de déterminer la fonction de décryptage ; aide initialement verrouillée.
Source
- Public Class Form1
- Dim A As Integer
- Dim B As Integer
- Dim C As Integer
- Dim D As Integer
-
-
-
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
-
- End Sub
-
- Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
-
- End Sub
-
- Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
-
- End Sub
-
- Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
- TextBox5.Text = ""
- End Sub
-
- Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
- TextBox4.Text = TextBox2.Text
- End Sub
-
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim I As Long
- Dim Car As Char
- Dim F As Integer
- TextBox2.Text = ""
- For I = 1 To Len(TextBox1.Text)
- Car = Mid(TextBox1.Text, I, 1)
- F = Asc(Car)
- If F >= 97 And F <= 122 Then
- F = (A * (F - 97) + B) Mod 26 + 97
- ElseIf (F >= 65 And F <= 90) Then
- F = (A * (F - 65) + B) Mod 26 + 65
- End If
- TextBox2.Text = TextBox2.Text + Chr(F)
- Next I
- End Sub
-
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
- A = ComboBox1.SelectedItem
- TextBox2.Text = ""
- End Sub
-
- Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
-
- End Sub
-
- Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
- B = ComboBox3.SelectedItem
- TextBox2.Text = ""
- End Sub
-
- Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
- TextBox2.Text = ""
- End Sub
-
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim I As Long
- Dim Car As Char
- Dim F As Integer
- TextBox5.Text = ""
- For I = 1 To Len(TextBox4.Text)
- Car = Mid(TextBox4.Text, I, 1)
- F = Asc(Car)
- If F >= 97 And F <= 122 Then
- F = (C * (F - 97) + D) Mod 26 + 97
- ElseIf (F >= 65 And F <= 90) Then
- F = (C * (F - 65) + D) Mod 26 + 65
- End If
- TextBox5.Text = TextBox5.Text + Chr(F)
- Next I
- End Sub
-
- Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
- C = ComboBox2.SelectedItem
- TextBox5.Text = ""
- End Sub
-
- Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
- D = ComboBox4.SelectedItem
- TextBox5.Text = ""
- End Sub
-
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- TextBox4.Text = TextBox2.Text
- End Sub
-
- Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
-
- End Sub
-
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- Dim S As Integer
- S = A ^ 11 Mod 26
- ComboBox2.Text = S
-
- End Sub
-
-
-
-
- Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
- If CheckBox1.Checked = True Then
- Button4.Visible = True
- Button5.Visible = True
- Button10.Enabled = True
- Button11.Enabled = True
- Else
- Button4.Visible = False
- Button5.Visible = False
- Button10.Enabled = False
- Button11.Enabled = False
- End If
- End Sub
-
-
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
- TextBox4.Text = "abcdefghijklmnopqrstuvwxyz"
- End Sub
-
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- Dim S As Integer
- S = A ^ 11 Mod 26
- ComboBox4.Text = ((26 - S) * B) Mod 26
- End Sub
-
- Private Sub ToolTip1_Popup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PopupEventArgs)
-
-
- End Sub
-
-
-
- Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
- If Not My.Computer.FileSystem.FileExists("Doc1.pdf") Then
- Using monstream As New IO.MemoryStream(My.Resources.Doc1)
- Using monfichier As New IO.FileStream("Doc1.pdf", IO.FileMode.Create)
- monstream.WriteTo(monfichier)
- End Using
- End Using
- End If
- Process.Start("Doc1.pdf")
-
-
-
- End Sub
-
- Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
- If Not My.Computer.FileSystem.FileExists("Doc2.pdf") Then
- Using monstream As New IO.MemoryStream(My.Resources.Doc2)
- Using monfichier As New IO.FileStream("Doc2.pdf", IO.FileMode.Create)
- monstream.WriteTo(monfichier)
- End Using
- End Using
- End If
- Process.Start("Doc2.pdf")
- End Sub
-
-
- Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
- If Not My.Computer.FileSystem.FileExists("Doc3.pdf") Then
- Using monstream As New IO.MemoryStream(My.Resources.Doc3)
- Using monfichier As New IO.FileStream("Doc3.pdf", IO.FileMode.Create)
- monstream.WriteTo(monfichier)
- End Using
- End Using
- End If
- Process.Start("Doc3.pdf")
- End Sub
-
- Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
- If Not My.Computer.FileSystem.FileExists("Doc4.pdf") Then
- Using monstream As New IO.MemoryStream(My.Resources.Doc4)
- Using monfichier As New IO.FileStream("Doc4.pdf", IO.FileMode.Create)
- monstream.WriteTo(monfichier)
- End Using
- End Using
- End If
- Process.Start("Doc4.pdf")
- End Sub
-
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
- If Not My.Computer.FileSystem.FileExists("Doc5.pdf") Then
- Using monstream As New IO.MemoryStream(My.Resources.Doc5)
- Using monfichier As New IO.FileStream("Doc5.pdf", IO.FileMode.Create)
- monstream.WriteTo(monfichier)
- End Using
- End Using
- End If
- Process.Start("Doc5.pdf")
- End Sub
- End Class
Public Class Form1
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
TextBox5.Text = ""
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox4.Text = TextBox2.Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim I As Long
Dim Car As Char
Dim F As Integer
TextBox2.Text = ""
For I = 1 To Len(TextBox1.Text)
Car = Mid(TextBox1.Text, I, 1)
F = Asc(Car)
If F >= 97 And F <= 122 Then
F = (A * (F - 97) + B) Mod 26 + 97
ElseIf (F >= 65 And F <= 90) Then
F = (A * (F - 65) + B) Mod 26 + 65
End If
TextBox2.Text = TextBox2.Text + Chr(F)
Next I
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
A = ComboBox1.SelectedItem
TextBox2.Text = ""
End Sub
Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
B = ComboBox3.SelectedItem
TextBox2.Text = ""
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox2.Text = ""
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim I As Long
Dim Car As Char
Dim F As Integer
TextBox5.Text = ""
For I = 1 To Len(TextBox4.Text)
Car = Mid(TextBox4.Text, I, 1)
F = Asc(Car)
If F >= 97 And F <= 122 Then
F = (C * (F - 97) + D) Mod 26 + 97
ElseIf (F >= 65 And F <= 90) Then
F = (C * (F - 65) + D) Mod 26 + 65
End If
TextBox5.Text = TextBox5.Text + Chr(F)
Next I
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
C = ComboBox2.SelectedItem
TextBox5.Text = ""
End Sub
Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
D = ComboBox4.SelectedItem
TextBox5.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox4.Text = TextBox2.Text
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim S As Integer
S = A ^ 11 Mod 26
ComboBox2.Text = S
End Sub
Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Button4.Visible = True
Button5.Visible = True
Button10.Enabled = True
Button11.Enabled = True
Else
Button4.Visible = False
Button5.Visible = False
Button10.Enabled = False
Button11.Enabled = False
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox4.Text = "abcdefghijklmnopqrstuvwxyz"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim S As Integer
S = A ^ 11 Mod 26
ComboBox4.Text = ((26 - S) * B) Mod 26
End Sub
Private Sub ToolTip1_Popup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PopupEventArgs)
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If Not My.Computer.FileSystem.FileExists("Doc1.pdf") Then
Using monstream As New IO.MemoryStream(My.Resources.Doc1)
Using monfichier As New IO.FileStream("Doc1.pdf", IO.FileMode.Create)
monstream.WriteTo(monfichier)
End Using
End Using
End If
Process.Start("Doc1.pdf")
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If Not My.Computer.FileSystem.FileExists("Doc2.pdf") Then
Using monstream As New IO.MemoryStream(My.Resources.Doc2)
Using monfichier As New IO.FileStream("Doc2.pdf", IO.FileMode.Create)
monstream.WriteTo(monfichier)
End Using
End Using
End If
Process.Start("Doc2.pdf")
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
If Not My.Computer.FileSystem.FileExists("Doc3.pdf") Then
Using monstream As New IO.MemoryStream(My.Resources.Doc3)
Using monfichier As New IO.FileStream("Doc3.pdf", IO.FileMode.Create)
monstream.WriteTo(monfichier)
End Using
End Using
End If
Process.Start("Doc3.pdf")
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
If Not My.Computer.FileSystem.FileExists("Doc4.pdf") Then
Using monstream As New IO.MemoryStream(My.Resources.Doc4)
Using monfichier As New IO.FileStream("Doc4.pdf", IO.FileMode.Create)
monstream.WriteTo(monfichier)
End Using
End Using
End If
Process.Start("Doc4.pdf")
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If Not My.Computer.FileSystem.FileExists("Doc5.pdf") Then
Using monstream As New IO.MemoryStream(My.Resources.Doc5)
Using monfichier As New IO.FileStream("Doc5.pdf", IO.FileMode.Create)
monstream.WriteTo(monfichier)
End Using
End Using
End If
Process.Start("Doc5.pdf")
End Sub
End Class
Historique
- 23 décembre 2011 20:15:51 :
- Le .exe ne figure pas dans le zip.
- 23 décembre 2011 21:24:50 :
- Ajout des fichiers source.
- 24 décembre 2011 11:20:26 :
- Suppression des sub sans code
Zip de tout le dossier du projet hors bin et release.
- 24 décembre 2011 14:41:35 :
- Niveau débutant !
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
[Cryptographie] RSA [ par Rurouni ]
Bonjour,Je suis en train d essayer de faire un RSA en visual basic selon la demandede mon maitre de stage.J en suis au point de calculer la clef prive
Comment créer dynamiquesment des groupes de controls ? [ par xavier ]
Salut, j'arrive à créer dynamiquement des controls dans une fenetre, ne sachant pas à l'avance quels sont les types et le nombre de ces controls. J'ut
comment créer dynamiquement des groupes de controls ? [ par xavier ]
Qqun sait comment je peux faire pour créer dynamiquement des groupes de controls ?Exemple : créer un nombre choisi de frames avec un nombre choisi d'o
Récupération des groupes utilisateurs sous ACCESS [ par Nitocris ]
Lorsqu'une base est sécurisé avec l'assistant d'ACCESS.Comment peut-on récupérer sous la forme d'une String le ou les groupe(s) d'utilisateur auquel i
Macro Word + visual basic [ par voily2001 ]
Salut ,voila je vous expose mon problème.J'ai un fichier texte de compremant des groupes de lignes séparées par des sauts de page.Ensuite j'ai un tab
pb avec mscomm [ par zagalo ]
salutj'ai fait un terminale telephonique avec le mscomm de visual basic,le programme fontionne correctement (il compose un numéro j'ecoute la voix de
VBS, WMI & groupes locaux [ par rodrigos ]
Salut!Je suis en train de me mettre au vbscript et j'aimerai savoir comment on peut obtenir l'ensemble des utilisateurs d'un groupe local: par exemple
Shape Group [ par starsky ]
Bonjour à tous,J'ai une feuille dans laquelle se trouve 3 groupes de plusieurs checkBox chacune: mon problème est de connaître les valeurs de ces chec
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|