daily pastebin goal
48%
SHARE
TWEET

Basi Di Crittografia #2

Driverfury Feb 24th, 2016 343 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def cripta(stringa, chiave):
  2.     stringaCifrata = ""
  3.     stringa = stringa.lower()
  4.     i = 0
  5.     for lettera in stringa:
  6.         posizione = (ord(lettera) - 97 + chiave[i]) % 26
  7.         if ord(lettera) >= 97 and ord(lettera) <= 122:
  8.             stringaCifrata += chr(97 + posizione)
  9.             i += 1
  10.         else:
  11.             stringaCifrata += lettera
  12.         if i >= len(chiave):
  13.             i = 0
  14.     return stringaCifrata
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
 
Top