Advertisement
ProgrameruPokusaju

cipher

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