Advertisement
opexxx

fcc0084d67dedebb13af7847d4d8d29d527483ccf85487128f42d878aa16

Sep 25th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import time
  3.  
  4. def encryptText(plainText, key):
  5.     encryptedText = ""
  6.     for i in plainText:
  7.         encryptedText += chr((ord(i) + key) % 254)
  8.     return encryptedText
  9.  
  10. def decryptText(encryptedText, key):
  11.     plainText = ""
  12.     for i in encryptedText:
  13.         plainText += chr((ord(i) - key) % 254)
  14.     return plainText
  15.  
  16. def encryptList(plainList, key):
  17.     encryptedList = []
  18.     for part in plainList:
  19.         encryptedPart = encryptText(part, key)
  20.         encryptedList.append(encryptedPart)
  21.     return encryptedList
  22.  
  23. def decryptList(encryptedList, key):
  24.     decryptedList = []
  25.     for part in encryptedList:
  26.         decryptedPart = decryptText(part, key)
  27.         decryptedList.append(decryptedPart)
  28.     return decryptedList
  29.  
  30. def getKey():
  31.     return int((time.time() * 10) % 100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement