Skip to content

Commit 9dd6a7c

Browse files
committed
Fix
1 parent a89555b commit 9dd6a7c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ciphers/caesar_cipher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ def brute_force(input_string: str, alphabet: str | None = None) -> dict[int, str
188188
complex the cipher, the larger amount of time it will take to do brute force
189189
190190
Ex:
191-
Say we have a ``5`` letter alphabet (``abcde``), for simplicity and we intercepted the
192-
following message: ``dbc``,
191+
Say we have a ``5`` letter alphabet (``abcde``), for simplicity and we intercepted
192+
the following message: ``dbc``,
193193
we could then just write out every combination:
194194
``ecd``... and so on, until we reach a combination that makes sense:
195195
``cab``

ciphers/decrypt_caesar_with_chi_squared.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def decrypt_caesar_with_chi_squared(
6565
Each letter in the english alphabet has a frequency, or the amount of times
6666
it shows up compared to other letters (usually expressed as a decimal
6767
representing the percentage likelihood). The most common letter in the
68-
english language is ``e`` with a frequency of ``0.11162`` or ``11.162%``. The test is
69-
completed in the following fashion.
68+
english language is ``e`` with a frequency of ``0.11162`` or ``11.162%``.
69+
The test is completed in the following fashion.
7070
7171
1. The ciphertext is decoded in a brute force way (every combination of the
7272
``26`` possible combinations)
@@ -75,7 +75,8 @@ def decrypt_caesar_with_chi_squared(
7575
multiplying the total number of characters by the frequency of the letter.
7676
7777
| For example:
78-
| In a message of ``100`` characters, ``e`` should appear around ``11.162`` times.
78+
| In a message of ``100`` characters, ``e`` should appear around ``11.162``
79+
times.
7980
8081
3. Then, to calculate the margin of error (the amount of times the letter
8182
SHOULD appear with the amount of times the letter DOES appear), we use

0 commit comments

Comments
 (0)