Codebusters B/C

Sorrow2
Member
Member
Posts: 29
Joined: December 8th, 2022, 3:05 pm
State: KS
Pronouns: He/Him/His
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: Codebusters B/C

Post by Sorrow2 »

Is there any codebusters book that you guys can recommend? I love to read. Thank you in advance!
I wake up. its only me. I look at my reflection, its only me. I've only woke up to me and only me. no one with me.
its fine. perfectly fine.
User avatar
Umaroth
Exalted Member
Exalted Member
Posts: 398
Joined: February 10th, 2018, 8:51 pm
Division: C
State: CA
Pronouns: He/Him/His
Has thanked: 167 times
Been thanked: 325 times

Re: Codebusters B/C

Post by Umaroth »

Sorrow2 wrote: March 22nd, 2023, 9:37 am Is there any codebusters book that you guys can recommend? I love to read. Thank you in advance!
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
Mythic
Member
Member
Posts: 9
Joined: December 19th, 2022, 9:35 am
Division: B
State: MI
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Codebusters B/C

Post by Mythic »

knightmoves wrote: March 16th, 2023, 10:28 am
Mythic wrote: March 15th, 2023, 5:48 pm Hello, I was wondering if someone could explain how you solve the Cryptanalysis of an Affine.
Here'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 ;)
Thanks for the idea but I was wondering how you went from (68 + b) mod 26 = 1 --> (16 + b) mod 26 = 1
Mythic
Member
Member
Posts: 9
Joined: December 19th, 2022, 9:35 am
Division: B
State: MI
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Codebusters B/C

Post by Mythic »

Mythic wrote: March 27th, 2023, 2:25 pm
knightmoves wrote: March 16th, 2023, 10:28 am
Mythic wrote: March 15th, 2023, 5:48 pm Hello, I was wondering if someone could explain how you solve the Cryptanalysis of an Affine.
Here'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 ;)
Thanks for the idea but I was wondering how you went from (68 + b) mod 26 = 1 --> (16 + b) mod 26 = 1
I now understand this 😂 but I can't solve this question.

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?
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Codebusters B/C

Post by knightmoves »

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".
These users thanked the author knightmoves for the post:
Mythic (March 27th, 2023, 7:58 pm)
Mythic
Member
Member
Posts: 9
Joined: December 19th, 2022, 9:35 am
Division: B
State: MI
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Codebusters B/C

Post by Mythic »

knightmoves wrote: March 27th, 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".
OMG Thanks I stopped at 10 I didn't realize I had to go further. Thanks again :)
Sorrow2
Member
Member
Posts: 29
Joined: December 8th, 2022, 3:05 pm
State: KS
Pronouns: He/Him/His
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: Codebusters B/C

Post by Sorrow2 »

knightmoves wrote: March 16th, 2023, 10:28 am
Mythic wrote: March 15th, 2023, 5:48 pm Hello, I was wondering if someone could explain how you solve the Cryptanalysis of an Affine.
Here'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 ;)
Affine Cipher looks confusing ;-;
I wake up. its only me. I look at my reflection, its only me. I've only woke up to me and only me. no one with me.
its fine. perfectly fine.
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Codebusters B/C

Post by knightmoves »

Sorrow2 wrote: March 28th, 2023, 6:03 am Affine Cipher looks confusing ;-;
;)

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.
Mythic
Member
Member
Posts: 9
Joined: December 19th, 2022, 9:35 am
Division: B
State: MI
Pronouns: He/Him/His
Has thanked: 2 times
Been thanked: 0

Re: Codebusters B/C

Post by Mythic »

Hi, quick question on Fractionated Morse does it always end in X or XX or does it vary?
knightmoves
Member
Member
Posts: 629
Joined: April 26th, 2018, 6:40 pm
Has thanked: 4 times
Been thanked: 108 times

Re: Codebusters B/C

Post by knightmoves »

Mythic wrote: April 5th, 2023, 6:17 pm Hi, quick question on Fractionated Morse does it always end in X or XX or does it vary?
https://www.soinc.org/relating-fraction ... end-mark-0
Locked

Return to “2023 Study Events”

Who is online

Users browsing this forum: No registered users and 0 guests