Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # Cipher algorithm made by Aleksandar Arsic
- # Name of algorithm: ReturnNull
- import time
- import logging
- import locale
- def cipher(plain_text):
- # direction can be 0 (is reversible) by default or 1 (not reversible)
- listOfCharacters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
- 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- '!', '?', '_', '.', ',', '-', '#', '$', '%', '^', '&', '*', '=', 'A', 'B', 'C', 'D', 'E', 'F',
- 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
- 'Z'] # 75 items
- logging.warning(listOfCharacters)
- plain = plain_text # Plain text to be ciphered
- plainArray = plain.split() # Split each character from plain text and put it in array
- current_time = time.strftime("%H:%M:%S")
- timeArray = current_time.split(":")
- logging.warning(current_time) # Prints current time
- current_date = time.strftime("%d/%m/%Y")
- dateArray = current_date.split("/")
- logging.warning(current_date) # Prints current date
- key = listOfCharacters[locale.atoi(timeArray[2]) + 1] + listOfCharacters[locale.atoi(timeArray[1]) + 1] + \
- listOfCharacters[locale.atoi(timeArray[0]) + 1]
- logging.warning(key)
- # Add list shuffle with date parameters. Key code represents given time of making cipher.
- cipher("Random")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement