Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import time
- def encryptText(plainText, key):
- encryptedText = ""
- for i in plainText:
- encryptedText += chr((ord(i) + key) % 254)
- return encryptedText
- def decryptText(encryptedText, key):
- plainText = ""
- for i in encryptedText:
- plainText += chr((ord(i) - key) % 254)
- return plainText
- def encryptList(plainList, key):
- encryptedList = []
- for part in plainList:
- encryptedPart = encryptText(part, key)
- encryptedList.append(encryptedPart)
- return encryptedList
- def decryptList(encryptedList, key):
- decryptedList = []
- for part in encryptedList:
- decryptedPart = decryptText(part, key)
- decryptedList.append(decryptedPart)
- return decryptedList
- def getKey():
- return int((time.time() * 10) % 100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement