Advertisement
Guest User

ADFGX MOTD.py

a guest
Aug 5th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.90 KB | None | 0 0
  1. keyword = ["654321", "654231", "654213", "654123", "654132", "654312", "653421", "653412", "653241", "653214", "653142", "653124", "652431", "652413", "652341", "652314", "652143", "652134", "651432", "651423", "651243", "651234", "651324", "651342", "564321", "564231", "564213", "564123", "564132", "564312", "563421", "563412", "563241", "563214", "563142", "563124", "562431", "562413", "562341", "562314", "562143", "562134", "561432", "561423", "561243", "561234", "561324", "561342"]
  2. aSq = "ABCDEFGHIKLMNOPQRSTUVWXYZ"
  3. pSq = ["AA","AD","AF","AG","AX","DA","DD","DF","DG","DX","FA","FD","FF","FG","FX","GA","GD","GF","GG","GX","XA","XD","XF","XG","XX"]
  4. cipher = ["FGGFFFFFFXF", "FFGFDDDGXFA", "GFDXGGGFFXG", "XADXFFGGXDG", "GGGFFFFADGFA", "DFFFGGFAXFFF"]
  5. newCipher = ["", "", "", "", "", ""]
  6.  
  7. def main():
  8.     print("Enter your AlphabetSquare in the syntax of:\n ABCDEF, A being slot 1, you know the deal. Press 1 to use default aSQ.")
  9.     response = input("Enter your aSq: ")
  10.     if response == "1":
  11.         print("Preparing...")
  12.     else:
  13.             response = aSq
  14.                
  15.     for x in range(0, len(keyword)):
  16.        
  17.         cipherPT = ""
  18.         letter = ""
  19.         PT = ""
  20.         ##print("Keyword: ", keyword[x])
  21.        
  22.         for a in range(0, len(cipher)):
  23.             newCipher[a] = cipher[int(keyword[x][a])-1]
  24.  
  25.         for a in range(0, 11):
  26.             for b in range(0, len(newCipher)):
  27.                 cipherPT += newCipher[b][a]
  28.                
  29.         for a in range(0, len(cipherPT),2):
  30.             for b in range(0, len(pSq)):
  31.                
  32.                 if cipherPT[a:a+2] == (pSq[b]):
  33.                     PT += aSq[b]
  34.  
  35.         if int(keyword[x][0]) == 6:
  36.             PT += "L"
  37.         elif int(keyword[x][0]) == 5:
  38.             PT += "C"
  39.         else:
  40.             print("We dun goofed")
  41.        
  42.         print("PlainText: ", PT)    
  43.  
  44. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement