This commit is contained in:
mdecker62
2026-03-12 15:01:40 -04:00
parent a89b8e04e1
commit 4d08a0d4fa

13
caesar_cracker.py Normal file
View File

@@ -0,0 +1,13 @@
from collections import Counter
def crack_caesar(ciphertext):
counts = Counter(ciphertext.upper())
most_common_letter = counts.most_common(1)[0][0]
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
shift = (alphabet.index(most_common_letter) - alphabet.index("E")) % 26
return shift