Advertisement
Driverfury

Basi Di Crittografia #3 - Codice 1

Mar 2nd, 2016
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def cripta(stringa, chiave):
  2.     stringaCifrata = ""
  3.     i = 0
  4.     for lettera in stringa:
  5.         stringaCifrata += chr((ord(lettera) + chiave[i]) % 128)
  6.         i += 1
  7.         if i >= len(chiave):
  8.             i = 0
  9.     return stringaCifrata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement