Jul 03, 2024

Wiki

Python

Aide

edit SideBar

Search

Permutations

  #-*-coding:utf8-*-
  from copy import deepcopy
  from random import shuffle
  alphabet = [chr(k) for k in range(ord('A'),ord('Z')+1)]
  key = deepcopy(alphabet)
  shuffle(key)
  print "La clé est : ", ''.join(key)
  message = raw_input("Quel texte chiffrer ? ")
  crypto = ''.join([key[alphabet.index(k)] for k in message])
  print "Cryptogramme :", crypto
  print "Déchiffrement :", ''.join([alphabet[key.index(k)] for k in crypto])

Page Actions

Recent Changes

Group & Page

Back Links