Codebusters B/C
-
- Member
- Posts: 26
- Joined: Thu Dec 08, 2022 3:05 pm
- State: KS
- Pronouns: He/Him/His
- Has thanked: 4 times
- Been thanked: 1 time
Re: Codebusters B/C
Is there any codebusters book that you guys can recommend? I love to read. Thank you in advance!
"Kakarot! I've placed my pride.. My promise.. Everything in your hands. Your defeat is unacceptable. Step over the state of the Gods and Defeat Jiren, Kakarot!" -Vegeta
-
- Exalted Member
- Posts: 395
- Joined: Sat Feb 10, 2018 8:51 pm
- Division: C
- State: CA
- Pronouns: He/Him/His
- Has thanked: 167 times
- Been thanked: 325 times
Re: Codebusters B/C
If you're reading to get better at the event, there won't be anything like that to help since this event is pretty much entirely practice-based
Cal 2026
Troy SciOly 2021 Co-Captain
Proud Padre of the Evola SciOly Program 2018-now
Dank Memes Area Homeschool Juggernaut 2018-now
Sierra Vista SciOly Co-Head Coach 2020-now
Umaroth's Userpage
Troy SciOly 2021 Co-Captain
Proud Padre of the Evola SciOly Program 2018-now
Dank Memes Area Homeschool Juggernaut 2018-now
Sierra Vista SciOly Co-Head Coach 2020-now
Umaroth's Userpage
-
- Member
- Posts: 9
- Joined: Mon Dec 19, 2022 9:35 am
- Division: B
- State: MI
- Pronouns: He/Him/His
- Has thanked: 2 times
- Been thanked: 0
Re: Codebusters B/C
Thanks for the idea but I was wondering how you went from (68 + b) mod 26 = 1 --> (16 + b) mod 26 = 1knightmoves wrote: ↑Thu Mar 16, 2023 10:28 amHere's a worked example for you. You are given the cyphertext
"ABOBRFLYBMLHGQBPSLYLSSRYBTODGWLYLQDFRF", and told that the first two letters of the plaintext are H and E.
So you know that under the affine encryption, E(4) -> B(1) and H(7) ->A (0).
So (4a + b) mod 26 = 1
and (7a + b) mod 26 = 0
Subtracting these, you get 3a mod 26 = -1 = 25.
So we're hunting for a value of a for which 3a mod 26 = 25.
3a = 25 is no good, 'cause a needs to be an integer.
3a = 51 gives a = 17, which is a viable solution.
3a = 77 doesn't have an integer solution, and then there aren't any other valid solutions, because you know a<26.
So with a=17, the first equation becomes
(68 + b) mod 26 = 1
or equivalently
(16 + b) mod 26 = 1
And so b = 11.
Now you have determined a and b, you can compute the mappings.
A(0) -> (b mod 26) = 11 = L
B(1) -> (a + b) mod 26 = 2 = C
C(2) -> (2a + b) mod 26 = 19 = T
D(3) -> (3a + b) mod 26 = 10 = K.
And so on.
You might prefer to compute the mappings for the high frequency letters (etaoin shrdlu...) rather than doing them in alphabetical order. Finishing this off is left as an exercise for the reader![]()
-
- Member
- Posts: 9
- Joined: Mon Dec 19, 2022 9:35 am
- Division: B
- State: MI
- Pronouns: He/Him/His
- Has thanked: 2 times
- Been thanked: 0
Re: Codebusters B/C
I now understand thisMythic wrote: ↑Mon Mar 27, 2023 2:25 pmThanks for the idea but I was wondering how you went from (68 + b) mod 26 = 1 --> (16 + b) mod 26 = 1knightmoves wrote: ↑Thu Mar 16, 2023 10:28 amHere's a worked example for you. You are given the cyphertext
"ABOBRFLYBMLHGQBPSLYLSSRYBTODGWLYLQDFRF", and told that the first two letters of the plaintext are H and E.
So you know that under the affine encryption, E(4) -> B(1) and H(7) ->A (0).
So (4a + b) mod 26 = 1
and (7a + b) mod 26 = 0
Subtracting these, you get 3a mod 26 = -1 = 25.
So we're hunting for a value of a for which 3a mod 26 = 25.
3a = 25 is no good, 'cause a needs to be an integer.
3a = 51 gives a = 17, which is a viable solution.
3a = 77 doesn't have an integer solution, and then there aren't any other valid solutions, because you know a<26.
So with a=17, the first equation becomes
(68 + b) mod 26 = 1
or equivalently
(16 + b) mod 26 = 1
And so b = 11.
Now you have determined a and b, you can compute the mappings.
A(0) -> (b mod 26) = 11 = L
B(1) -> (a + b) mod 26 = 2 = C
C(2) -> (2a + b) mod 26 = 19 = T
D(3) -> (3a + b) mod 26 = 10 = K.
And so on.
You might prefer to compute the mappings for the high frequency letters (etaoin shrdlu...) rather than doing them in alphabetical order. Finishing this off is left as an exercise for the reader![]()
Decode this sentence which has been encoded with an Affine cipher that starts with TH
MWFPF IRXP, RKK DF WFRS ROBJM TP MWRM MWF TEIJPMSX. TP TE MSBJOKF. FGFSXOBIX TP PB PLRSFI, OJM BJS HTPPTBE PMRMFHFEM TP WRGTEZ EB CFRS.
Could you please help me solve this question?
-
- Member
- Posts: 586
- Joined: Thu Apr 26, 2018 6:40 pm
- Has thanked: 4 times
- Been thanked: 102 times
Re: Codebusters B/C
Same principle. You know T(19) -> M(12)and H(7) -> W (22)
So (19a + b) mod 26 = 12
and (7a + b) mod 26 = 22
Subtract to get
12a mod 26 = (-10) = 16 [-10 is 16 because we're doing arithmetic in mod 26]
Now hunt for a solution
12a = 16 is no good (16/12 has remainder 4)
12a = 42 is no good (42/12 has remainder 6)
12a = 68 is no good (68/12 has remainder 8)
you can see the pattern now, right? we're going to want
12a = 120 -> a = 10
Are there other possibilities?
12a = 146 is no good (146/12 has remainder 2)
12a = 172 is no good (172/12 has remainder 4)
...
12a = 276 -> a = 23
So either a = 10 or a = 23.
If a = 10, (70 + b) mod 26 = 22
so b=4
If a = 23, (161+b)mod26 = 22
so (5+b) = 22
b = 17.
So you have two possibilities = (a,b) = (10,4) or (23,17).
But a=10 isn't a viable solution (10 is not coprime with 26), so (a,b) = (23,17) is the only possible solution.
Now you have a and b, you can build the mapping table as before.
Clue: the answer begins "THESE DAYS, ALL WE HEAR ABOUT".
So (19a + b) mod 26 = 12
and (7a + b) mod 26 = 22
Subtract to get
12a mod 26 = (-10) = 16 [-10 is 16 because we're doing arithmetic in mod 26]
Now hunt for a solution
12a = 16 is no good (16/12 has remainder 4)
12a = 42 is no good (42/12 has remainder 6)
12a = 68 is no good (68/12 has remainder 8)
you can see the pattern now, right? we're going to want
12a = 120 -> a = 10
Are there other possibilities?
12a = 146 is no good (146/12 has remainder 2)
12a = 172 is no good (172/12 has remainder 4)
...
12a = 276 -> a = 23
So either a = 10 or a = 23.
If a = 10, (70 + b) mod 26 = 22
so b=4
If a = 23, (161+b)mod26 = 22
so (5+b) = 22
b = 17.
So you have two possibilities = (a,b) = (10,4) or (23,17).
But a=10 isn't a viable solution (10 is not coprime with 26), so (a,b) = (23,17) is the only possible solution.
Now you have a and b, you can build the mapping table as before.
Clue: the answer begins "THESE DAYS, ALL WE HEAR ABOUT".
- These users thanked the author knightmoves for the post:
- Mythic (Mon Mar 27, 2023 7:58 pm)
-
- Member
- Posts: 9
- Joined: Mon Dec 19, 2022 9:35 am
- Division: B
- State: MI
- Pronouns: He/Him/His
- Has thanked: 2 times
- Been thanked: 0
Re: Codebusters B/C
OMG Thanks I stopped at 10 I didn't realize I had to go further. Thanks againknightmoves wrote: ↑Mon Mar 27, 2023 6:57 pm Same principle. You know T(19) -> M(12)and H(7) -> W (22)
So (19a + b) mod 26 = 12
and (7a + b) mod 26 = 22
Subtract to get
12a mod 26 = (-10) = 16 [-10 is 16 because we're doing arithmetic in mod 26]
Now hunt for a solution
12a = 16 is no good (16/12 has remainder 4)
12a = 42 is no good (42/12 has remainder 6)
12a = 68 is no good (68/12 has remainder 8)
you can see the pattern now, right? we're going to want
12a = 120 -> a = 10
Are there other possibilities?
12a = 146 is no good (146/12 has remainder 2)
12a = 172 is no good (172/12 has remainder 4)
...
12a = 276 -> a = 23
So either a = 10 or a = 23.
If a = 10, (70 + b) mod 26 = 22
so b=4
If a = 23, (161+b)mod26 = 22
so (5+b) = 22
b = 17.
So you have two possibilities = (a,b) = (10,4) or (23,17).
But a=10 isn't a viable solution (10 is not coprime with 26), so (a,b) = (23,17) is the only possible solution.
Now you have a and b, you can build the mapping table as before.
Clue: the answer begins "THESE DAYS, ALL WE HEAR ABOUT".
![Smile :)](./images/smilies/icon_e_smile.gif)
-
- Member
- Posts: 26
- Joined: Thu Dec 08, 2022 3:05 pm
- State: KS
- Pronouns: He/Him/His
- Has thanked: 4 times
- Been thanked: 1 time
Re: Codebusters B/C
Affine Cipher looks confusing ;-;knightmoves wrote: ↑Thu Mar 16, 2023 10:28 amHere's a worked example for you. You are given the cyphertext
"ABOBRFLYBMLHGQBPSLYLSSRYBTODGWLYLQDFRF", and told that the first two letters of the plaintext are H and E.
So you know that under the affine encryption, E(4) -> B(1) and H(7) ->A (0).
So (4a + b) mod 26 = 1
and (7a + b) mod 26 = 0
Subtracting these, you get 3a mod 26 = -1 = 25.
So we're hunting for a value of a for which 3a mod 26 = 25.
3a = 25 is no good, 'cause a needs to be an integer.
3a = 51 gives a = 17, which is a viable solution.
3a = 77 doesn't have an integer solution, and then there aren't any other valid solutions, because you know a<26.
So with a=17, the first equation becomes
(68 + b) mod 26 = 1
or equivalently
(16 + b) mod 26 = 1
And so b = 11.
Now you have determined a and b, you can compute the mappings.
A(0) -> (b mod 26) = 11 = L
B(1) -> (a + b) mod 26 = 2 = C
C(2) -> (2a + b) mod 26 = 19 = T
D(3) -> (3a + b) mod 26 = 10 = K.
And so on.
You might prefer to compute the mappings for the high frequency letters (etaoin shrdlu...) rather than doing them in alphabetical order. Finishing this off is left as an exercise for the reader![]()
"Kakarot! I've placed my pride.. My promise.. Everything in your hands. Your defeat is unacceptable. Step over the state of the Gods and Defeat Jiren, Kakarot!" -Vegeta
-
- Member
- Posts: 586
- Joined: Thu Apr 26, 2018 6:40 pm
- Has thanked: 4 times
- Been thanked: 102 times
Re: Codebusters B/C
![Wink ;)](./images/smilies/icon_e_wink.gif)
Modular arithmetic takes a bit of getting used to. Once that makes sense, the affine cypher really isn't too bad. This is cryptanalysis of the affine cypher, which is the most complicated affine problem you might see, and even then, it's an almost completely mechanical process. There's no guessing letter combinations required: it's a small amount of arithmetic, plus a large amount of turning the handle.
-
- Member
- Posts: 9
- Joined: Mon Dec 19, 2022 9:35 am
- Division: B
- State: MI
- Pronouns: He/Him/His
- Has thanked: 2 times
- Been thanked: 0
Re: Codebusters B/C
Hi, quick question on Fractionated Morse does it always end in X or XX or does it vary?