generated from mwc/lab_encryption
When I was trying to figuer out the
problem and how t slve it I started to plan like I do lessons. First I needed to goal (which was given to us) then I broke down the pieces of the goal and how they might be accomplished. Overall the code itself took a few tries to figure out. But for the most part the struggles I had were related to making the code I wrote compatable with the process that is already in place. For example, I struggled when importing some of the other equations, but once I stepped back and looked at the pieces of the solution I needed, they started to come together. I also loved that the codes were poems. It made my English teacher brain so excited. I started to look at the physical encryption and tried to guess the poems or genres. It was a really fun process!
This commit is contained in:
parent
b3b113704f
commit
d9b142d8ad
12
answers.md
12
answers.md
|
@ -3,19 +3,21 @@
|
|||
## Checkpoint 1
|
||||
|
||||
0. `secrets/secret0.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
its secret number? 78
|
||||
|
||||
I love sonnets, this made the English techer part of my heart grow three sizes.
|
||||
|
||||
1. `secrets/secret1.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
its secret number? 1
|
||||
|
||||
2. `secrets/secret2.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
its secret number? 44
|
||||
|
||||
3. `secrets/secret3.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
its secret number? 59
|
||||
|
||||
4. `secrets/secret4.txt` is encrypted using a Caesar Cipher. What is
|
||||
its secret number?
|
||||
its secret number? 32
|
||||
|
||||
## Checkpoint 2
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
from collections import Counter
|
||||
from easybits import Bits
|
||||
|
||||
def crack_caesar(ciphertext):
|
||||
frequencies = Counter(ciphertext)
|
||||
most_common = frequencies.most_common(1)[0]
|
||||
most_common_character = most_common[0]
|
||||
|
||||
space_value = Bits(' ').int
|
||||
character_value = Bits(most_common_character).int
|
||||
|
||||
shift = character_value - space_value
|
||||
|
||||
return shift
|
Loading…
Reference in New Issue