SHARE
TWEET

Untitled

zeeph Jan 15th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #Version plus rapide recommandé
  3. u = 5
  4. key = []
  5.  
  6. while u not in key:
  7.     key.append(u)
  8.     u = (2 * u + 7 ) % 26
  9. print(key)
  10. # Résultat [5, 17, 15, 11, 3, 13, 7, 21, 23, 1, 9, 25]
  11.  
  12. """
  13. Cryptage avec une suite
  14.  
  15. """
  16. # Ce script permet de savoir la position des lettres du message
  17. msg = "BONJOURLEMONDE"
  18. letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  19. result = []
  20.  
  21. for i, k in enumerate(msg): # Créer un compteur sur la liste ou la chaine de caractère
  22.     if i < len(msg):
  23.         pos = (letters.index(k) + key[i % len(key)])  
  24.         result.append(pos)
  25. print(result)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top