Sujet : Aide pour coder un scrypt de cryptograhpie De : nospam_taarco.moi (at) *nospam* gmail.com.invalid (taarco) Groupes :fr.comp.lang.python Date : 04. Mar 2022, 17:31:44 Autres entêtes Organisation : !No_Organization! Message-ID :<8ridnf3Ir8p9rb__nZ2dnUU7_8zNnZ2d@giganews.com>
Bonjour, j'ai commencé à créer mon code qui doit crypter un message à l'aide d'une clé (C'est un devoir à rendre), mais je suis bloqué, et je en sais plus comment faire, quelqu'un pourrait m'aider ? Voici mon code :
import random
alphabet = [i for i in 'abcdefghijklmnopqrstuvwxyz '] #liste par compréhension phrase = input("Ecrivez une phrase:").lower() clee=int(input("Clée :"))
Alphabet_Melange=[i for i in 'abcdefghijklmnopqrstuvwxyz '] random.shuffle(Alphabet_Melange) print(Alphabet_Melange) final="" for i in phrase: n_Lettre = alphabet.index(i) print(n_Lettre) final+=Alphabet_Melange[n_Lettre] print(final,Alphabet_Melange)