Really Small Algorithm

[Cryptography – 150 pts ]

This problem is titled Really Small Algorithm. Since the title has the initials R-S-A, I assumed it was an RSA challenge.

Lets open the address in netcat:

It opens up to a very familiar set of numbers, N, E, and C (or in this case, CT. C or CT stands for Cipher or CipherText).

 So, since we have everything, this shouldn’t be that hard to decipher.

After a few minutes of online searching, I came across a stack overflow post where one guy suggested using a tool called RsaCtfTool.

Here is the link to it:
https://github.com/Ganapati/RsaCtfTool

After I git cloned it to my desktop on kali linux, I opened up a terminal. I cd into the directory of the tool.

 Lets go back to the post to see how to format our command

Which explains to do it as python RSACtfTool – n {n} -e {e} – -uncipher {c}

I replicate the command using the numbers we got from the challenge (However, I substituted python3 for python, as that was the version of python I had installed on my machine.

Lets try it:

 It worked! Even though we had some errors, the tool ‘unciphered’ the cipher. (Down there at the bottom)

Flag: ractf{S0m3t1mesS1zeDoesM4773r}

RSABC

 This problem is called RSABC.


I’d assume this problem has something to do with RSA. Just a guess. And It could maybe have something to do with the “ABC’s” of RSA. Who knows.

Lets click the links.

 The first link we get is a link to a very refreshing ASMR video of a medieval battle.  

 After a few minutes of relaxing, I opened the second link.

Here we find a familiar set of numbers, an N, an E, and a C.  

 So since we have everything, this shouldn’t be that hard to decipher.

After a few minutes of online searching, I cam across a stack overflow post where one guy suggested using a tool called RsaCtfTool

https://github.com/Ganapati/RsaCtfTool

 Here is the link to it:

https://github.com/Ganapati/RsaCtfTool

After I cloned it to my desktop on kali linux, I opened up a terminal. I cd into the directory of the tool.

 lets go back to the post to see how to format our command.

which explains to do it as python RSACtfTool – n {n} -e {e} –uncipher {c}

I replicate the command using the numbers we got from the challenge. Then I press enter.

Hmm, we got an error.

I figured I would try the command using python3 instead of python.

 It worked! The tool ‘unciphered’ the cipher. (Down there at the bottom)

Flag: tjctf{BOLm1QMWi3c}

Typewriter

 Okay, this problem is called Typewriter. Right off the bat we can tell its some kind of substitution cipher, as the description contains what looks like a full flag expect the letters have been jumbled.

(A substitution cipher is when one character is substituted for another.)

Substitution ciphers are generally easy because they usually follow some sort of rule.  

 The actual first thing I did was try to have my browser solve it automatically, there are plenty of online solvers. I tried dcode.fr for example, but that resulted in nothing. (I didn’t take any screenshots) 

Well, I guess I actually have to put in some effort. Taking another look at the description, it said that he was pranked and his typewriter’s keys had been re-arranged. As in, some kind of key-layout. So all we have to do is find out what that key layout was and reverse it.

Lets take a look at what we do know:  

 We know that zpezy really should turn into tjctf. So whatever alphabet they are using to substitute the characters, z maps to t and p maps to j etc. 

For a more visual viewing of this keymap, I edited an image of a QWERTYIUOP keyboard.

 taking what we know from above, I drew arrows point to the ‘switched’ keys. T maps to Z and J maps to P, etc.

 However, at this point, I did not notice any pattern whatsoever and I shelved the problem for a day until a hint came out. Regrettably, I had to use the hint to solve the problem, but in my defense, it was a really big hint.

 The hint says that a becomes q, b becomes w, c becomes e, f becomes y, j becomes p, t becomes z, and z becomes m. Did I notice a pattern in my head? I didn’t. So I went back and mapped the keys on my little diagram.

 Wait a second, I notice something – QWE all have letters switching to them. Lets see what they are:

 What, the numbers that replace Q,W, and E, are A,B, and C??? what are the chances??

Well, not really. Its pretty easy to tell at this point. The keyboard mapping had been switched out of the QWERTYIUOP layout and into an alphabetic layout, ABCDEFGEHIJ layout. Not a bad prank.

 So know we know out substitution alphabet. Lets go slam it into the converter.

I open up Cyberchef (Cyberchef OP btw) and paste in the garbled flag. Then I search for substitute and double click it to add it to the recipe.  

Now, we have to craft the recipe just right or it won’t work. I removed alphabets and added in my new ones. I put removed the Uppercase alphabets (there are no uppercase letters in the flag, so cyberchef won’t pick them up) and replaced the ciphertext alphabet with a normal, lowercase alphabet.

 then I added the first row of a QWERTYUIOP keyboard into the Plaintext alphabet. Again, in lowercase)

 And instantly I see some of the letters start to change, for example, I see the zpezy{ turn into zjczf{.

Next, I added the middle row of the qwerty keyboard, and then the lower row of the keyboard into the plaintext alphabet.

And it looks like we have a flag. Some parts of it appear to still be garbled, but I submitted it and it worked.

Flag: tjctf{red_orange_purple_efgrirroiefe_pineapple_fruit_auhsdeuhfn}

Circles

 This problem is titled “Circles” for 10 points. The flag evaded me for a while as did it many other teams, I’ve heard, resulting in it having fewer solves than many of the ‘tougher’ problems.

Lets have a look at the image. It appears to be some sort of substitution cipher where the letters have been replaced with circles. I can’t determine any hidden meaning within the circles, there doesn’t seem to be any remnants of English letters in them.

 A quick google search for circle cipher or circle text results in nothing. A Long google search resulted in nothing. These type of symbols being used as characters simply did not exist. (supposedly)

Lets take a look at the problem description. (You know, I actually had to have the hint tell me to do this – I didn’t actually take a good look at the description before this)

 It comprises of a rather strange sentence. That has to have a special meaning. Lets google it.

 Hmm, a Google search matches word for word the description of the problem located on a website  Fonts.com. Lets check it out.

 I searched for ‘circles’ but found nothing among the 8 results.

Okay, maybe there is a better description for the font. I search for ‘circular’ and the first result appears to match our cipher perfectly. Yay.

 After I click the page of the circular font, which I learn is called USF Circular Designs, I type in ‘tjctf’ into the test bar to see if it matches. It does, giving us the same first segment of what we see in the cipher image.

 Unfortunately there appears to be no “USF Circular Designs to Ascii” converter that I can find, so we’ll have to do this by hand.

When I click to see the full character map, to my dismay, I see it maps them to Unicode Code points instead of anything in English. (I can’t read Unicode Code Points)

Now we will have to yet another step by hand.

 Alright, lets look at the first unknown circle. It looks like, well, a circle. Looking back at the character map, my best guess is that it maps to the Unicode Code Point 0042.

 (looks like 0042)

 Okay now lets convert this Unicode Code Point into an ascii character. Unicode-search.net has just what we need. I enter 0042 in, and we get the character B (Capital B) as the result.

 So now we know that the flag starts as tjctf{B

The next character is this skip-sign, which maps to 0033.

 It turns out to really just be the number 3.

  The next one is 0061 and it turns out to be a lowercase a.

So now we have the flag so far as tjctf{B3a

 I repeat this process for the remainder of the circles in the cipher and it comes out as this:

And we have our flag.

Flag: tjctf{B3auT1ful_f0Nt}