Split each cipher into its own file
[cipher-tools.git] / cipher.py
index f938f3677f321d02805688ac443328314af0406f..248155edb8a54956df51348a64fc26c9532db339 100644 (file)
--- a/cipher.py
+++ b/cipher.py
@@ -1,23 +1,31 @@
-import string
+# import string
+# import collections
+# import math
+# from enum import Enum
+# from itertools import zip_longest, cycle, chain, count
+# import numpy as np
+# from numpy import matrix
+# from numpy import linalg
+# from language_models import *
+# import pprint
 
 
-def caesar_cipher_letter(letter, shift):
-    if letter in string.ascii_letters:
-        if letter in string.ascii_lowercase:
-            return chr((ord(letter) - ord('a') + shift) % 26 + ord('a'))
-        else:
-            new_letter = letter.lower()
-            yolo = chr((ord(new_letter) - ord('a') + shift) % 26 + ord('a'))
-            return yolo.upper()
-    else:
-        return letter
 
-def caesar_decipher_letter(letter, shift):
-    return caesar_cipher_letter(letter, -shift)
+from utilities import *
+from segment import *
+from text_prettify import *
+from plot_frequency_histogram import *
 
-def caesar_cipher_message(message, shift):
-    big_cipher = [caesar_cipher_letter(l, shift) for l in message]
-    return ''.join(big_cipher)
+from caesar import *
+from affine import *
+from keyword import *
+from polybius import *
+from column_transposition import *
+from railfence import *
+from cadenus import *
+from hill import *
+from amsco import *
+from bifid import *
+from autokey import *
+from pocket_enigma import *
 
-def caesar_decipher_message(message, shift):
-    return caesar_cipher_message(message, -shift)