begin process at 2012 05 24 00:09:44
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Sécurité & cryptage

 > CRYPTAGE DE MOTS/PHRASES.

CRYPTAGE DE MOTS/PHRASES.


 Information sur la source

Note :
9 / 10 - par 1 personne
9,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Sécurité & cryptage Classé sous :cryptage, décryptage, caesar, algorithme, phrase Niveau :Débutant Date de création :12/04/2005 Date de mise à jour :15/10/2005 13:36:19 Vu / téléchargé :7 513 / 279

Auteur : bouceka

Ecrire un message privé
Site perso
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Voici un programme qui crypte un mot ou une phrase à l'aide de l'algorythme
de cryptage du chiffre de caesar.

Source

  • # -*- coding: cp1252 -*-
  • from Tkinter import *
  • #--------------fonction qui crypte--------
  • def crypt():
  • mot = entree.get()
  • cle = entree1.get()
  • alph = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
  • c = ""
  • i,a = 0,0
  • b,o = 0,0
  • while len(c) < len(mot):
  • if mot[i] in alph:
  • if mot[i] == alph[a]:
  • b = int(cle[o])
  • c = c + alph[(a+b)%53]
  • i += 1
  • o = (o+1)%len(cle)
  • a = (a+1)%53
  • else:
  • c = c + "*"
  • i += 1
  • crypter.set(c)
  • #-------------fonction qui decrypt---------
  • def decrypt():
  • mot = entre.get()
  • cle = entre1.get()
  • alph = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
  • c = ""
  • i,a = 0,0
  • b,o = 0,0
  • while len(c) < len(mot):
  • if mot[i] in alph:
  • if mot[i] == alph[a]:
  • b = int(cle[o])
  • c = c + alph[(a-b)%53]
  • i += 1
  • o = (o+1)%len(cle)
  • a = (a+1)%53
  • else:
  • c = c + "*"
  • i += 1
  • crypter1.set(c)
  • #---- Prog Main ----
  • fen = Tk()
  • fen.title("By Bouceka")
  • bou2 = Button(fen,text ='Quitter',fg ='red',command =fen.quit)
  • bou2.grid(row =8,columnspan =2)
  • #---- Cryptage -----
  • Label(fen,text='.: CRYPTAGE :.',fg ='black').grid(row =0,columnspan =2)
  • Label(fen,text='Texte a crypter : ',fg ='blue').grid(row =1,sticky =W)
  • Label(fen,text='Clé de cryptage : ',fg ='blue').grid(row =2,sticky =W)
  • crypter = StringVar()
  • crypt1 = Entry(fen,textvariable = crypter)
  • crypt1.grid(row =3,column =1)
  • crypter.set("Texte crypté")
  • entree = Entry(fen,fg='brown')
  • entree.grid(row =1,column =1)
  • mot = entree.get()
  • entree1 = Entry(fen,fg ='brown')
  • entree1.grid(row =2,column =1)
  • bou1 = Button(fen,text ='Crypter',fg ='blue',command =crypt)
  • bou1.grid(row = 3)
  • #---- DECRYPTAGE ----
  • Label(fen,text ='.: DECRYPTAGE :.',fg ='black').grid(row =4,columnspan =2)
  • Label(fen,text ='Texte a décrypter : ',fg ='blue').grid(row =5,sticky =W)
  • Label(fen,text ='Clé de décryptage : ',fg ='blue').grid(row =6,sticky =W)
  • entre = Entry(fen,fg ='brown')
  • entre.grid(row =5,column =1)
  • entre1 = Entry(fen,fg ='brown')
  • entre1.grid(row =6,column =1)
  • crypter1 = StringVar()
  • crypt2 = Entry(fen,textvariable = crypter1)
  • crypt2.grid(row =7,column =1)
  • crypter1.set("Texte décrypté")
  • bou2 = Button(fen,text ='Décrypter',fg ='blue',command =decrypt)
  • bou2.grid(row =7)
  • fen.mainloop()
  • fen.destroy()
# -*- coding: cp1252 -*-
from Tkinter import *


#--------------fonction qui crypte--------
def crypt():
    mot = entree.get()
    cle = entree1.get()
    alph = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
    c = ""
    i,a = 0,0
    b,o = 0,0
    while len(c) < len(mot):
        if mot[i] in alph:
            if mot[i] == alph[a]:
                b = int(cle[o])
                c = c + alph[(a+b)%53]
                i += 1
                o = (o+1)%len(cle)
            a = (a+1)%53
        else:
            c = c + "*"
            i += 1
    crypter.set(c)

#-------------fonction qui decrypt---------
def decrypt():
    mot = entre.get()
    cle = entre1.get()
    alph = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
    c = ""
    i,a = 0,0
    b,o = 0,0
    while len(c) < len(mot):
        if mot[i] in alph:
            if mot[i] == alph[a]:
                b = int(cle[o])
                c = c + alph[(a-b)%53]
                i += 1
                o = (o+1)%len(cle)
            a = (a+1)%53
        else:
            c = c + "*"
            i += 1
    crypter1.set(c)

#---- Prog Main ----
fen = Tk()
fen.title("By Bouceka")

bou2 = Button(fen,text ='Quitter',fg ='red',command =fen.quit)
bou2.grid(row =8,columnspan =2)

#---- Cryptage -----
Label(fen,text='.: CRYPTAGE :.',fg ='black').grid(row =0,columnspan =2)
Label(fen,text='Texte a crypter : ',fg ='blue').grid(row =1,sticky =W)
Label(fen,text='Clé de cryptage : ',fg ='blue').grid(row =2,sticky =W)

crypter = StringVar()
crypt1 = Entry(fen,textvariable = crypter)
crypt1.grid(row =3,column =1)
crypter.set("Texte crypté")

entree = Entry(fen,fg='brown')
entree.grid(row =1,column =1)

mot = entree.get()

entree1 = Entry(fen,fg ='brown')
entree1.grid(row =2,column =1)

bou1 = Button(fen,text ='Crypter',fg ='blue',command =crypt)
bou1.grid(row = 3)

#---- DECRYPTAGE ----
Label(fen,text ='.: DECRYPTAGE :.',fg ='black').grid(row =4,columnspan =2)

Label(fen,text ='Texte a décrypter : ',fg ='blue').grid(row =5,sticky =W)
Label(fen,text ='Clé de décryptage : ',fg ='blue').grid(row =6,sticky =W)

entre = Entry(fen,fg ='brown')
entre.grid(row =5,column =1)

entre1 = Entry(fen,fg ='brown')
entre1.grid(row =6,column =1)

crypter1 = StringVar()
crypt2 = Entry(fen,textvariable = crypter1)
crypt2.grid(row =7,column =1)
crypter1.set("Texte décrypté")



bou2 = Button(fen,text ='Décrypter',fg ='blue',command =decrypt)
bou2.grid(row =7)

fen.mainloop()
fen.destroy()



 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Historique

27 mai 2005 14:58:54 :
Changement...
27 mai 2005 15:05:49 :
changement...
26 juin 2005 15:08:24 :
Ajout d'une interface graphique + un fichier ZIP.
15 octobre 2005 13:36:00 :
Légère améiolaration du code.
15 octobre 2005 13:36:19 :
Légère amélioration du code.

 Sources du même auteur

Source avec Zip LISTEUR DE FICHIER EN RÉSEAUX
Source avec Zip SCANNER DE PORTS.
JEU DU 21.

 Sources de la même categorie

Source avec une capture GÉNÉRATEUR DE MOT DE PASSE PYTHON (CLI) par svmars
Source avec Zip Source avec une capture GÉNÉRATEUR DE MOT DE PASSE PYTHON / WXPYTHON par svmars
CRYPTE ET DECRYPTE UN FICHIER (AVEC HASH POUR VÉRIFICATION) par saigneurdushi
Source avec Zip CRYPTEUR CARRE DE POLYBE par Dipx
Source avec une capture HORAIRESRESTREINTS par lonewolfs

 Sources en rapport avec celle ci

Source avec Zip PALINDROMES, ANACYCLIQUES ET ANAGRAMMES par lespinx
Source avec Zip CRYPTEUR CARRE DE POLYBE par Dipx
TROUVER TOUT LES QUADRILATÉRES POSSIBLES AVEC N POINTS ALEAT... par Buenol
Source avec Zip Source avec une capture CHIFFRE DE VIGENÈRE par benitoelputoamo
Source avec Zip Source avec une capture CRYPTEUR/DÉCRYPTEUR MD5 (PAR DICO) par thecryingshadow

Commentaires et avis

Commentaire de lepecheur le 09/05/2005 17:27:27

Je vais laisser s'écouler une semaine avant de me lâcher  sur l'orthographe exécrable de la source...

Peut-être les administrateurs sont-ils moins indulgent ....

Commentaire de econs le 09/06/2005 11:52:29 administrateur CS

Apparemment, des changements ont été effectués sur l'orthographe ... il reste des erreurs, mais rien de bien exécrable. Y'a franchement pire.
Le code, lui, est parfaitement clair.
Une petite description de l'algo du chiffre de Caesar aurait été appréciable.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Cryptage DES [Python] [ par Kadaj676 ] Bonjour j'aimerais savoir si vous aviez de la documentation sur des algo's de cryptage. Principalement DES, et je voudrais vosu demander, si il est po Cryptage xor [ par sorcier0011 ] Bonjour,J'aimerais bien faire un petit crypteur de texte xor mais je n'arrive pas a trouver comment convertir des lettres en Ascii. Parce que apart fa Pour ne pas planter [ par franckysnow91 ] Bonjour à tous,Je programme un algorithme sous python et malheureusement, je fais souvent des boucles perverses et je ne réussi pas à m'en sortir. Je Algorithme Python parité [HELP] [ par Lyd3n ] Bonjour, j'ai besoin d'aide pour un programme que je dois rendre a un professeur qui m'a poser des contraintes : je ne dois utiliser que "[i]input[/i [Programme Python] Cryptage RSA (cherche codeur) [ par GelH ] Bonjour, Je recherche un codeur Python capable de réaliser un programme de cryptage/décryptage d'une chaine de caractère utilisant l'algorithme RSA. Morpion 3D [ par lola413 ] Bonjour, Dans le cadre de mon cours de programmation j'ai pour exercice (a rendre pour le 23, youpi!) de réaliser un morpion 4*4 en 3D (alignement de


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

Photothèque

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 4,540 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales