generated from mwc/lab_encryption
Unfinished encryption lab answers.
This commit is contained in:
10
answers.md
10
answers.md
@@ -4,19 +4,19 @@
|
||||
|
||||
0. `secrets/secret0.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
|
||||
78
|
||||
1. `secrets/secret1.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
|
||||
1
|
||||
2. `secrets/secret2.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
|
||||
44
|
||||
3. `secrets/secret3.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
|
||||
59
|
||||
4. `secrets/secret4.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
|
||||
32
|
||||
## Checkpoint 2
|
||||
|
||||
5. What is the polyalphabetic secret word?
|
||||
|
||||
8
caesar_cracker.py
Normal file
8
caesar_cracker.py
Normal 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
|
||||
Reference in New Issue
Block a user