Unfinished encryption lab answers.

This commit is contained in:
jkissane2
2026-04-06 23:56:33 -04:00
parent d2711f367b
commit d31003d5df
3 changed files with 14 additions and 5 deletions

8
caesar_cracker.py Normal file
View File

@@ -0,0 +1,8 @@
from collections import Counter
from easybits import Bits
def crack_caesar(ciphertext):
counts = Counter(ciphertext)
most_common_char, _ = counts.most_common(1)[0]
shift = Bits(most_common_char).int - Bits(' ').int
return shift