dirist_15.py 288 B

1234567891011
  1. def encrypt(key,text,dec=1):
  2. if __name__ == '__main__':
  3. encrypted = ""
  4. key = hasher(key)
  5. dupkey = key
  6. for i in range(len(text)):
  7. new = chr(ord(text[i])+ dec*(dupkey%10))
  8. encrypted = encrypted + new
  9. if dupkey==0: dupkey = key
  10. dupkey = int(dupkey/10)
  11. return encrypted