About

HSCTF 2020 Crypto - XKCD 2247 v2

XKCD.com/2247 v2 Why v2? because organizers messed up in v1 by providing plaintext in the challenge and the flag read wrapmeintheflagformatandputunderscoresaroundmywords weird flag but ok. As the name suggests it is Hill Cipher We are provided with the ciphertext and key, we just have to decrypt the ciphertext using the key. The ciphertext s...

Read more

HSCTF 2020 Crypto - XORed

XORed I was given the following equations. Can you help me decode the flag? Key 1 = 5dcec311ab1a88ff66b69ef46d4aba1aee814fe00a4342055c146533 Key 1 ^ Key 3 = 9a13ea39f27a12000e083a860f1bd26e4a126e68965cc48bee3fa11b Key 2 ^ Key 3 ^ Key 5 = 557ce6335808f3b812ce31c7230ddea9fb32bbaeaf8f0d4a540b4f05 Key 1 ^ Key 4 ^ Key 5 = 7b33428eb14e4b54f2f4a3acae...

Read more

HSCTF 2020 Crypto - Unexpected

Unexpected We are given 3 N’s and 3 C’s and given that all three share primes i.e N1 = p*q N2 = q*r N3 = r*p This is a problem of classic RSA with a small twist. Now, we know factoring N into their factors is hard. However this can be don easily considering we have a common factor between pairs of N i.e q is a common factor of N1 and N2, r i...

Read more

HSCTF 2020 Crypto - Randomization 2

Randomization 2 Again, we are provided a binary rand2 which runs on the server. On connecting to the server, we’re provided with 2 numbers and then we’re asked to guess the next numbers several(10) times. Going ahead, let’s use Ghidra to decompile this binary, and then work our ass off to understand the terrible decompiled code. Just kidding...

Read more

HSCTF 2020 Crypto - Randomization 1

Randomization 1 We are provided a binary rand1 which supposedly runs on the server. We have to figure out how would capture the flag Lets decompile the binary quickly in Ghidra. Seeing the output of main function we get undefined8 main(void) { uint uVar1; undefined8 uVar2; long in_FS_OFFSET; int local_1c; int local_18; int local...

Read more

HSCTF 2020 Crypto - Extremely Complex Challenge

Extremely Complex Challenge We are given two points on an Elliptic Curve, its order and parameter b. Using these quantities, we can recover parameter a. y^2 = x^3 + ax + b (mod p) y^2 - x^3 - b = ax (mod p) If we have two points on curve, (x1, y1) and (x2, y2), we can get (y1^2 - x1^3) - (y2^2 - x2^3) = a(x1 - x2) (mod p) a = (x1 - x2)^-1...

Read more